Results 1 to 6 of 6
I keep getting this error message when i try to run one of my script
test4: line 9: syntax error near unexpected token `)'
test4: line 9: ` *) echo ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 05-10-2005 #1Just Joined!
- Join Date
- May 2005
- Posts
- 4
Error Message Help
I keep getting this error message when i try to run one of my script
test4: line 9: syntax error near unexpected token `)'
test4: line 9: ` *) echo $k ;; '
I have been trying for hours to fix this but nothing seems to work. What can i do to fix this??
- 05-10-2005 #2
Can you paste your script?
- 05-10-2005 #3Just Joined!
- Join Date
- May 2005
- Posts
- 4
Yeah sure
##test4
for k in `echo $*`
do
case $k in
[1-9]*) echo $k | tr [1-9][0-8] ;;
[a-f]*) echo $k | tr [a-e][U-Y] ;;
[U-Z]*) echo $k | tr [U-Z][L-Q] ;;
[i-k]*) echo "Hey"
*) echo $k ;;
esac
done
(THIS IS NOT HW)
- 05-10-2005 #4Linux Enthusiast
- Join Date
- Jan 2005
- Posts
- 575
You forgot to put ;; in the Hey line.
- 05-10-2005 #5Just Joined!
- Join Date
- May 2005
- Posts
- 4
Thanks for help..I typed the ;; after hey and got this message
tr: two strings must be given when translating unused
not sure if this is an error message or not but oh well
Thanks for the help guys
- 05-10-2005 #6
You should be putting spaces between the [foo-bar][baz-blech] commands in 'tr'.
so, for example, instead of:
doCode:[U-Z]*) echo $k | tr [U-Z][L-Q] ;;
Code:[U-Z]*) echo $k | tr [U-Z] [L-Q] ;;


Reply With Quote
