Mail Archives: cygwin/2004/04/13/15:35:45
On Tue, 13 Apr 2004, Christopher Spears wrote:
> I created the following script:
>
> #!/bin/tcsh
>
> #csh script to prepend standard input to file argument
> #Version 1
>
> #name temp file
> set tf = /tmp/ppd.$$
>
> #get argument name
> set dest = $argv[1]
>
> #copy standard input, $dest to $tf
> cat - $dest > $tf
>
> #replace original file
> mv $tf $dest
>
> However, when I run the script in the tcsh with the
> following command line:
> (date; du ~) | ./ppd.txt ~/disk_storage&
>
> I get a syntax error (set: Syntax Error).
>
> I posted this script on an online Linux forum. A
> member copied it into vi, and it worked fine. Is
> there something in Cygwin that I need to do? I have
> written #!/bin/tcsh at the top, and I haved used set
> before in tcsh.
Nope. WFM in Cygwin 1.5.9, tcsh 6.12.00, Win2k. This could be caused by
the presence of a control character in your script (e.g., if you edited it
in MS Word). Try changing the first line to "#!/bin/tcsh -x" to see
exactly which commands are invoked. Pipe stderr through "cat -A" to see
any special characters.
Igor
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -