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

Recommended Answers

chmod u+x shellProgramming To make it executable ./shellProgramming To run it.

Jump to Post

All 3 Replies

chmod u+x shellProgramming To make it executable ./shellProgramming To run it.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.