2

I have a tcsh script that sets aliases during login. It seems like the last line in the file is not executed. If I put a new line after it - it works fine.

Example - bad:

...  
...  
...  
alias psu 'ps -fu ${LOGNAME}' <-- This does not run!!!

Example - good:

...  
...  
...  
alias psu 'ps -fu ${LOGNAME}' <-- This runs fine!!!
--> Empty line here

Any idea why?

1 Answer 1

2

Because tcsh needs a CR character at the end of the line to execute the command, which is missing in your first example. Just end every line in a shell script with the enter key to be on the safe side.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .