bash-based Unix Shell Script: Difference between revisions

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

Latest revision as of 03:30, 24 September 2021

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