The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
$PWD shows absolute path vs path w/symbolic links kornshellmaven Shell Programming and Scripting 3 06-13-2007 12:15 PM
about UNIX? original version? slowchem UNIX for Dummies Questions & Answers 4 12-07-2006 01:25 AM
vi - replacing a relative path with absolute path in a file Yinzer955i UNIX for Dummies Questions & Answers 2 09-07-2006 11:47 AM
ftp - get file and keep original timestamp? frustrated1 Shell Programming and Scripting 2 03-15-2006 01:31 PM
Sort - original order .... Help olga UNIX for Dummies Questions & Answers 2 06-01-2005 08:26 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-16-2001
therealtiger therealtiger is offline
Registered User
  
 

Join Date: May 2001
Location: Aurora, CO
Posts: 4
Question

I've got one I haven't been able to figure out.

1. A shell script exists- /junk/junk1/junk2/junk3.sh
2. From within the above named shell script, I want to know the full path of the above named shell script. Even if I execute the shell script from a directory other than the one it resides in, I want to know the directory where the script resides, not the path where the script was executed from.

For example:

I'm in: /home/myhome
and I put the following on the command line: /junk/junk1/junk2/junk3.sh
I want the following stored to a variable inside the script: /junk/junk1/junk2
I don't want the following stored to a variable inside the script: /home/myhome

How do I figure this out?

TIA
Paul
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0