my first script (lol)

hey peeps

ive made my first script, its for my work made in HP-UX, kshell

anyways

the script copies 3 files from a spider system to the floppydrive of my collegeau, I want to check if there is a floppy in the drive otherwise the script just runs forever and I don't have that time a day ;),... anybody got a idea ?

thnx in advance

EJ

Depends on how you copy the files.

If you mount the floppy first, before the copy, you get a error message on the mount command.

if you just copy a file to a device like cp <file> /dev/fd0/<file> you get a error message on the cp command.

You can test the exit-code of the last executed command, like

if [[ ! $? = 0 ]]
then
echo "error occured"
else
echo " no error"
fi

where $? stands for the exit code.
See also:
http://www.cs.princeton.edu/~jlk/kornshell/doc/man93.html