![]() |
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 |
| Bash copy file contents into an existing file at a specific location | gshepherd7 | Shell Programming and Scripting | 6 | 03-11-2009 09:26 AM |
| Exit from sourced script | angad.makkar | Shell Programming and Scripting | 2 | 03-04-2009 06:35 AM |
| copy files from one location to similar location | pharos467 | UNIX for Advanced & Expert Users | 1 | 09-21-2008 01:21 PM |
| which file is sourced by bash on login (Mac OS X 10.5.3)? | Alex_Land | OS X (Apple) | 2 | 07-11-2008 11:52 PM |
| What is the file location? | Chanakya.m | Shell Programming and Scripting | 5 | 07-17-2006 01:42 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
The sample scripts below, I am looking for the location of the sourced b.sh file. The b.sh file is source by multiple files, so it is not feasible to rely on a "global" variable or passed argument. Is there any way to determine the location of b.sh within b.sh?
a.sh Code:
#!/bin/ksh
echo "a: <$0>"
ScriptDir=`dirname $0`
. ${ScriptDir}/b.sh
b.sh Code:
#!/bin/ksh
WhereAmI="????"
echo "b: <$0> ${WhereAmI}"
|
| Bookmarks |
| Tags |
| ksh file directory |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|