Question about tcsh script

Status
Not open for further replies.

they

Junior Member level 2
Joined
Sep 14, 2004
Messages
24
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
265
When I write a foreach loop as below:

#######################################

#!/bin/tcsh -f

foreach file (\
a\
b\
c\
)

commands
.......
......
......

end

exit 0

################################

The script always executes the first file (a) only, after that it will report a message:
"Too many ')' s."
and stop the script.

May I know that what is the reason of that?
 

It seems all right. What is the exact code?
I have replaced commands with echo $file and tested the code, all worked fine.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…