i used vi: %vi shellProgramming
and then i typed the shell script in the vi and saved with :wq
However, when i run the vi file ...... %shellProgramming
my unix says "command not found"
why is that? and how do i run the vi shell scripting file? thanks
chmod u+x shellProgramming To make it executable ./shellProgramming To run it.
chmod u+x shellProgramming
./shellProgramming
can also name the file as shellProgramming.sh and diretly run it by giving it as
sh shellProgramming.sh
on the prompt.
Hey there,
You can also place it in a directory in your PATH, after you make it executable, so you can run it from anywhere.
I dont' recommend adding a dot to your PATH, but just do
echo $PATH
and copy your script into one of those directories and you can just run it by calling its name wherever you are on the filesystem :)
, Mike