bash-based Unix Shell Script

From GM-RKB
Jump to navigation Jump to search

A bash-based Unix Shell Script is a Unix Shell Script based on the bash Shell Program.



References


Examples

Redirecting stderr to stdout (and stdout to stderr)
$ (time sleep 1) 2>&1          | grep real
$ (time sleep 1) 3>&1 1>&2 2>&3 | grep real
Looping
$ loop="true" ;
$ while [ "$loop" == "true" ]; do sleep 2; \
    up=`uptime | awk '{print $8}'|sed "s/,//"| sed "s/\.//" | bc`; \
    echo "$up "; if [ $up -le 7]; then loop="false"; fi; done