Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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