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
get cygpath to leave relative paths as relative? fabulous2 UNIX for Dummies Questions & Answers 0 12-03-2007 07:45 AM
Finding relative path of a file chiru_h Shell Programming and Scripting 4 04-16-2007 08:20 PM
list all ports and their relative IP@ if any samsal_991 UNIX for Dummies Questions & Answers 4 04-10-2006 11:16 AM
relative pointers on Unix rahul_verma High Level Programming 3 07-24-2005 12:36 AM
Relative directory - NOT absolute sierra_aar Shell Programming and Scripting 4 09-09-2002 05:11 AM

Closed Thread
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
  #1 (permalink)  
Old 01-17-2008
rajarp rajarp is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 3
problem with relative pathing

Hi all,

My directory structure is as follows
home /md/DEV/SCRIPTS/DAILY and home/md/DEV/MIS/LANDING

so this command
find home/md/DEV/MIS/LANDING -name MIS_Customer_\*
is giving me the desired output
/home/md/DEV/MIS/LANDING/MIS_Customer_20080114.txt.
since i dont want to hardcode the path ie)home/md/DEV i opt for relative path like
find ../../MIS/LANDING -name MIS_Customer_\*.(since my scripts are in SCRIPTS/DAILY).because of this, am getting output
as
../../CIS/LANDING/MIS_Customer_20080114.txt which is undesirable.instead i want it like /home/md/DEV/MIS/LANDING/MIS_Customer_20080114.txt...pease help me to do this.or let me know if there is anyother workaround

regards,
rajarp
  #2 (permalink)  
Old 01-17-2008
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,117
Maybe something like this....

cd ../..
find `pwd`/MIS/LANDING -name MIS_Customer_\*
cd -

That "cd -" returns you to your last directory is most modern shells.
Closed Thread

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 07:26 PM.


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