954,546 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how do i run the shell script?

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

k2k
Posting Whiz
352 posts since Nov 2007
Reputation Points: 15
Solved Threads: 1
 

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

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

can also name the file as shellProgramming.sh and diretly run it by giving it as

sh shellProgramming.sh

on the prompt.

iceman29
Newbie Poster
12 posts since Feb 2008
Reputation Points: 10
Solved Threads: 2
 

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

eggi
Posting Pro in Training
400 posts since Oct 2007
Reputation Points: 102
Solved Threads: 47
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You