Link to home
Start Free TrialLog in
Avatar of skundu
skundu

asked on

Shell Scripts (URGENT Please)

I need to run shell scripts on my Unix machine. On the $ prompt, when I type echo $SHELL, it shows /bin/tcsh.
If I type myvariable=hello, it says "command not found". How to run this command.

Also for the following script:

x=0
while [$x -lt 10]
do
echo $x
x = 'echo $x + 1'
done

To run the above do I need to store it in a file and then execute the file? Please let me know in detail. Thanks
Avatar of ozo
ozo
Flag of United States of America image

#!/bin/tcsh
set x=0
while ( $x < 10 )
echo $x
@ x += 1
end
Avatar of skundu
skundu

ASKER

Thanks a lot. It worked.
Please tell me in tcsh shell, how can I assign a variable (say fruit) to a value (say apple)??
$fruit=apple
above command gives me error.

Also I have tchs shell, can I work on any other shell (like bash) somehow.
Please reply soon. Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Astroman
Astroman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skundu

ASKER

Thanks.
in tcsh

set fruit=apple
echo $fruit