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?

link|improve this question

feedback

1 Answer

up vote 1 down vote accepted

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.