I have a csh script that runs using "source" and passes all of its arguments to the program:
% alias foo source foo.csh % cat foo.csh ./bar $*
If I run source foo.csh abc , everything is fine. But not always:
foo "ab" "cd" :
I expect bar receive two arguments - ab and cd . Instead, he gets 4.
foo a "*" b : * expands to a list of files. I just want a character * .
Extra credit - foo a * b should work the same way. I know this is more problematic, and I want to live without it.
One thing I tried is changing ./bar $* to ./bar "$*" . This helps with an asterisk, but now bar always gets everything in one parameter.
Notes:
Our company uses csh as a login shell, so I have to use it when using source . Knowing that csh programming is considered harmful , I implemented all the logic in bar and left a minimum in the script.
If you suggest overriding the alias, it is important to make sure that the redirection still works ( foo | grep hello ) and that ctrl-C crashes the script.
linux csh
ugoren
source share