Computing.Net > Forums > Solaris > Executing shell program in ksh

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Executing shell program in ksh

Reply to Message Icon

Name: Satish
Date: June 25, 2003 at 14:06:42 Pacific
OS: Sun Solaris -7
CPU/Ram: 256mb
Comment:

hi,
I am working in Solaris 7 environment and on ksh. If I write a shell program in textpad,save and try executing it..,the program doesn't run.
Whereas, if i run the same in ksh command line ., the program runs. Likewise, if I add the program in .kshrc file and run it using any alias name..the program runs.

So my query is.., how do I execute the shell program written in a textpad.
i.e.,
Say I write a shell program and save it in a textpad say "test".
Now, i should be able to run the program by mere typing the file name "test".

Can anyone please answer this..



Sponsored Link
Ads by Google

Response Number 1
Name: David Perry
Date: June 25, 2003 at 14:37:40 Pacific
Reply:

You need to make the script executable.

chmod 775 test

If your current directory is not listing in your path prepend the script name the ./ when trying to execute.

./test

alternately, you could either modify your path or save the scripts in a directory already in your path.


0

Response Number 2
Name: satish
Date: June 26, 2003 at 10:37:12 Pacific
Reply:

Thanks a lot to you David for your quick response.

./ when used as prepend solved my problem.


0

Response Number 3
Name: satish
Date: June 26, 2003 at 10:39:56 Pacific
Reply:

Thanks a lot to you David for your quick response.

./ when used as prepend solved my problem.



0

Response Number 4
Name: WilliamRobertson
Date: July 9, 2003 at 15:51:16 Pacific
Reply:

btw, "test" is already a Unix command (see "man test") and so may not be the best choice for a test script name.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Solaris Forum Home


Sponsored links

Ads by Google


Results for: Executing shell program in ksh

David , help me with this script www.computing.net/answers/solaris/david-help-me-with-this-script/3625.html

Solaris Programming in Linux ? www.computing.net/answers/solaris/solaris-programming-in-linux-/2987.html

programming in c www.computing.net/answers/solaris/programming-in-c/2136.html