943,651 Members | Top Members by Rank

Ad:
May 21st, 2008
0

how do i run the shell script?

Expand Post »
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
Similar Threads
k2k
Reputation Points: 15
Solved Threads: 1
Posting Whiz
k2k is offline Offline
351 posts
since Nov 2007
May 21st, 2008
0

Re: how do i run the shell script?

chmod u+x shellProgramming To make it executable

./shellProgramming To run it.
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005
May 21st, 2008
0

Re: how do i run the shell script?

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

sh shellProgramming.sh

on the prompt.
Reputation Points: 10
Solved Threads: 2
Newbie Poster
iceman29 is offline Offline
12 posts
since Feb 2008
May 21st, 2008
0

Re: how do i run the shell script?

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
Reputation Points: 102
Solved Threads: 47
Posting Whiz
eggi is offline Offline
399 posts
since Oct 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: Script question
Next Thread in Shell Scripting Forum Timeline: Example BASh assignments





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC