![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Basic Linux Shell Scripting for Oracle DBAs | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 05:10 AM |
| got a basic doubt on cat-file permissions | ranj@chn | UNIX for Dummies Questions & Answers | 7 | 08-23-2007 05:39 AM |
| basic shell scripting question | convenientstore | Shell Programming and Scripting | 3 | 05-27-2007 10:21 PM |
| Certainly basic doubt about IF | tmxps | Shell Programming and Scripting | 1 | 10-31-2005 04:53 AM |
| What is a good place to learn basic shell scripting? Thanks! | deutchap6verse5 | Shell Programming and Scripting | 2 | 03-08-2005 02:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Shell scripting basic doubt
Hi,
I have a script called sam.sh which consists of a single echo statement like this #/usr/bin/ksh echo "Mani" I changed the mode for the script by giving chmod a+x sam.sh. If I want to execute the scrpt by just giving the name at the command line "sam.sh", what should I necessarily do? I dont want to execute the script as ./sam.sh Thanks in advance |
|
||||
|
The solutions above will only work if the directory containing the script is in your path - the reason you have to type ./sam.sh is to specify the that the script is in your current working directory (.).
You could change your path to include the directory containing the script (your home directory?) or the current directory (.) or, better, create an alias, e.g. Code:
alias sam.sh=<absolute directory path>/sam.sh Put this in your login file (.profile, .bash_profile, .cshrc or whatever it is for your system) to make it available each time you log in. cheers |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|