| mbenas 2003-04-20, 9:04 pm |
| I'm new in scripting so i need help for a script i want to create for my students.The thing goes like that :
A shell script to produce shar files, calculatin the cksum of the text files
##############################
########################
!EnShAr!
set `cksum cars`
test $1 = 1395987288 || echo $0: BAD checksum in cars >&2
cat > Unix <<\!EnShAr!
The Philosophy of Unix
======================
The name Unix means the opposite of MULTICS.
Small = beautiful.
Keep it simple.
##############################
##############################
#
. (But mine won't have been e-mailed, so they won't have any e-mail headers!)
If the script finds an error, it outputs an error message and executes an`exit n'. The required error messages and the values of `n' are as follows:
1 Usage: enshar file [ ... ]
2 enshar: <parameter>: can't be a pathname
3 enshar: <parameter>: is a directory
4 enshar: <parameter>: doesn't exist
5 enshar: <parameter>: can't be read
6 enshar: <parameter>: can't enshar
Thanks in advance for your cooperation |