Home > Archive > Sun Solaris > April 2003 > shar scripting





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author shar scripting
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
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net