Hi everyone,
below is an extract from a shell script i am tring to make, it is supposed to allow a user to supply files they want to view and the script prints the first lines of the each file and asks if they want to delete them. i have marked where the errors are, i know i am using the $ improperly.
any help would be appreciated thanks :)
count=1
while [ $# -ge $count ]
do
head $"$count"//error here
echo -e "Delete file $$count?? (y/n):"//error here
read answer
case $answer in
Y|y)rm $"$count"//error here
echo -e "File $$count deleted\n" ;;//error here
N|n)echo -e "File $$count NOT deleted\n" ;;//error here
*)echo "Invalid Command";;
esac
count=`expr $count + 1`
done