I am trying to learn shell scripting and trying to create a user defined variable within the script, first
:
howdy="Hello $USER !"
echo $howdy
However, when I execute the script (./first
) I get this:
howdy=Hello aaron!: Command not found.
howdy: Undefined variable.
What am I doing wrong?
You have two errors in you code:
Try this:
#!/bin/csh
set howdy="Hello $USER \!"
echo $howdy