[Gllug] csh shell scripting woes

Walid Shaari ws at melinux.com
Thu Mar 14 21:28:23 UTC 2002


On Thu, 2002-03-14 at 10:46, Huw Lynes wrote:
> On Thursday 14 March 2002 00:49, you wrote:
> >
> >
> > 	rename [OPT] src [...] dst
Are you sure you are calling your script {./rename} not something else
around ?!

> >
> > where OPT could be any of "-f" or "-i". The problem with this is that
> > if you invoke a csh-script with "-f" as one of the arguments, it
> > chokes and exits with this error message:
> 
> Erm, I may be misunderstanding ypu but passing stuff into csh should 
> not be a problem. As an utterly trivial example:
> 
> #!/bin/csh -f
> 
> echo $1
> echo $2
> 
> exit 0
> 
> can be run as ./scriptname -f somestuff
> outputting:
> 
> -f
> somestuff
> 
> Where is the problem? Once you have your -f inside the script as an 
> argument you can interpret it how you want. Like I said I may be 
> completely missing the point here.
> 
> -- 
> | Huw Lynes               | The Moving Picture Company  |
> | System Administrator    | 127 Wardour Street          |
> |.........................| London, W1F 0NL             | 
> 
> 
> 
> -- 
> Gllug mailing list  -  Gllug at linux.co.uk
> http://list.ftech.net/mailman/listinfo/gllug
> 



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list