Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi guys,
I was given a script from my teacher to do make some changes. However, I have no knowledge of program C. I would appreciate if anyone are able to advice me what is the error on the scripts.
The script is
echo " select any option to execute:"
echo " c or C: To connect Client to Server"
echo " r or R: To make a read request"
echo " s or S: I want to sort data"
echo " g or G: Look for a certain word in a file"
echo " e or E: quit"
echo -n "Enter your option and press <Enter>:"
set selection = `head -1`switch ("$selection")
case [cC]:
echo -n "enter server name"
set servername = `head -1`
find $servername
breakswcase [rR]:
cp
echo -n "enter server file to read content"
set serverfile = `head -1`
breakswcase [sS]:
sort
echo -n "enter server file to sort"
set serverfile1 = `head -1`
breakswcase [qQ]:
exit 0
breaksw
default:
case [qQ]:
exit 0
breaksw
default:
echo " wrong option."
exit 1
breaksw
endsw
exit 0I have change the script to executable.
When I run it, It showsdarren@linux:~$ ./clientlooker1
select any option to execute:
c or C: To connect Client to Server
r or R: To make a read request
s or S: I want to sort data
g or G: Look for a certain word in a file
e or E: quit
Enter your option and press <Enter>:4
./clientlooker1: line 10: syntax error near unexpected token `"$selection"'
./clientlooker1: line 10: ` switch ("$selection")'
darren@linux:~$If someone can advice me with this, that would be greatly appreciated.
Many thanks,
Darren

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |