mirror of
https://github.com/autistic-symposium/shell-whiz-toolkit.git
synced 2025-05-12 19:52:14 -04:00
some sytem scripts
This commit is contained in:
parent
4b0a965e4a
commit
5852171b21
25 changed files with 639 additions and 1 deletions
16
shell_scripts/lessons/while_loop_example.sh
Executable file
16
shell_scripts/lessons/while_loop_example.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
# script to test while statement
|
||||
|
||||
if [ $# -eq 0 ] # note the spaces
|
||||
then
|
||||
echo "Error, missing argument!"
|
||||
exit 1
|
||||
fi
|
||||
n=$1
|
||||
i=1
|
||||
while [ $i -le 10 ]
|
||||
do
|
||||
echo "$n * $i = `expr $i \* $n`"
|
||||
i=`expr $i + 1`
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue