Quote:
touch a1
if (test $# -eq 4)
echo " Enter 1 source file and 3 target files"
read a1 a2 a3 a4
then
cp $a1 $a2
cp $a1 $a3
cp $a1 $a4
else echo " Need exactly four parameters, sorry. "
fi
No point learning about this one.
The parameter count checking bit of the script does not work at all.
if (test $# -eq 4) does nothing except execute an irrelevant "test" in a subshell and ignore the result (which is good I suppose because $# has value zero at that moment).
The script collapses in a heap of "cp" errors if you just press return in response to the question.