about Grigoris Maravelias
Useful small things for c-shell

Useful small things for c-shell

> When using if statement in c-shell you have to be careful with the syntax:

if (condition) then
(commands)
endif

or if you want to add another case then

if (condition) then
(commands)
else
(commands)
endif

Important to remember that after “then” you must continue to a new line.

> “exit” is the one option to work with if statement, since “break” works only with foreach/while

> If you want to assign the output of a command to a variable the \n you have to place this into backticks ` … ` like:
set test = `grep "test text" temp`

Leave a Reply

Your email address will not be published. Required fields are marked *