LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-21-2006, 06:44 PM   #1
cdog
Member
 
Registered: Dec 2005
Posts: 65

Rep: Reputation: 15
Path manipulation


Hello guys
I want to write a script that's able to reconstruct it's full path using the $cwd and the $0
I found a way using cut and grep but it's kind of slow. Is there a way to cut the path from a certain field without knowing the number of fields?
Thanks
 
Old 12-21-2006, 08:51 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
If you mean you want the script to display or otherwise record the path to the directory in which the script is running, have the script call 'pwd' (without quotes).
 
Old 12-22-2006, 04:44 AM   #3
cdog
Member
 
Registered: Dec 2005
Posts: 65

Original Poster
Rep: Reputation: 15
No, I want to be able to know at any time the full path to the script (it can be moved by the user).
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
String manipulation Manuel Alvarado Linux - Newbie 2 09-06-2006 09:49 PM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM
More text manipulation ice_hockey Linux - General 2 05-28-2005 01:43 AM
help with data manipulation SeT Programming 2 10-20-2004 07:32 AM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration