LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to test csh? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-test-csh-892909/)

casualzone 07-21-2011 05:30 AM

how to test csh?
 
I am new to csh and i would like to learn csh (since most of the script is written in csh)

test.sh
#!/bin/csh -f
set mymachine = `uname -n`

is there a way to try and test it?

echo $mymachine
mymachine: Undefined variable.

colucix 07-21-2011 05:41 AM

Using the sha-bang as you did in your script should be enough. Otherwise you can create a test user and assign /bin/tcsh as the default shell, so that you have a complete login environment to test with. Regarding the Undefined variable error, it's really strange. Is the echo command inside the script?

Finally, a good reference for csh is www.kitebird.com/csh-tcsh-book/csh-intro.pdf. Hope this helps.

casualzone 07-21-2011 11:55 PM

i got it already
I use printf command to display at the xterm


All times are GMT -5. The time now is 11:23 AM.