July 2017
Beginner
208 pages
3h 7m
English
We'll see another script in the next section that uses a loop to put text on the screen:
#!/bin/sh # # 5/2/2017 # echo "script4 - Linux Scripting Book" if [ $# -ne 1 ] ; then echo "Usage: script4 string" echo "Will display the string on every line." exit 255 fi tput clear # clear the screen x=1 while [ $x -le $LINES ] do echo "********** $1 **********" let x++ done exit 0
Before executing this script run the following command:
echo $LINES
If the number of lines in that terminal is not displayed run the following command:
export LINES=$LINES
Then proceed to run the script. The following is the output on my system when run with script4 Linux:
Okay, so I agree this might not be terribly useful, but it does show a ...
Read now
Unlock full access