$1 ==> a
$2 ==> b ...
myscript a b c d e
echo $me --> prints the value of the variant
#144:
#!/bin/sh
while:
do
menu
echo "Please enter your choice : \c"
read ch
case
1) addnum ;;
2) veiwphone ;;
3) finduser ;;
9) exit ;;
sleep 3
esac
done
#addnum:
echo "Please enter your name :"
read name
echo "pls enter phone :"
read phone
echo "$name:$phone>>DB
#finduser:
echo "Plz enter name : \c"
read name
if grep "$name:" DB
then
:
else
echo "No much user :$name"
fi
#menu:
#!/bin/sh
clear
#openning line & closing line
cat < if file is readable
-w --> writable
-x --> executable
-f --> regular file
-d --> directory
---
a=`date +%H`
#a=`expr $x + 0`
if [ $a -lt 5]
then
echo -n "Good Night"
elif [ $a -lt 12 ]
then
echo -n "Good Morning"
elif [ $a -lt 18 ]
then
echo -n "Good Afternoon"
else
echo -n "Good Evening"
fi
echo " `whoani`"
-------------
tar cvL 5120 -f file_1.tar -f
file_2.tar -f file_3.tar file_to_split
to get the data: tar -xvM -f file_1.tar
-f file_2.tar -f file_3.tar
the M sais from a few archives
rar s -v3000 file.rar
#to mechanize as script:
if [-z "$1"] || [-z "$2"]; then
echo usage: $0 tarsize_in_megabyte filename
exit
fi
let archivesize=$1*1024
let filesize=`ls -la $2 | awk {print $5}`
let numarchive=$filesize/$archivesize/1024+1
tar_args=for((i=1;i<=$numarchive;i++));
do echo -n "-f $2_$i.tar";done
tar -cvL $archivesize $tar_args $2
-----------
|