bash-based Unix Shell Script: Difference between revisions

From GM-RKB
Jump to navigation Jump to search
 
m (Text replacement - "<U>See:</U>" to "See:")
Line 2: Line 2:
* <B>Context:</B>
* <B>Context:</B>
** It cam make use of a [[Unix Utility]].
** It cam make use of a [[Unix Utility]].
* <B><U>See:</U></B> [[perl-based Script]].
* <B>See:</B> [[perl-based Script]].
----
----
----
----

Revision as of 02:23, 22 September 2014

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