LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 08-02-2005, 10:24 AM   #1
ylikone
Member
 
Registered: Dec 2004
Location: Ontario, Canada
Distribution: ArchLinux, VectorLinux, Ubuntu, Debian, Linspire
Posts: 66

Rep: Reputation: 15
Need help with finding path in bash script


I have a little bash script as follows:

for i in $( ls */Maildir/cur/* ); do
echo item: $i
done

Now, this will list individual files in that directory, but how can I find the full path to each file? In case I want to do something like cp every file.
 
Old 08-02-2005, 10:47 AM   #2
ylikone
Member
 
Registered: Dec 2004
Location: Ontario, Canada
Distribution: ArchLinux, VectorLinux, Ubuntu, Debian, Linspire
Posts: 66

Original Poster
Rep: Reputation: 15
Figured it out myself...

using "find" instead of "ls" did the trick...

for i in $( find */Maildir/cur -type f -print ); do
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
finding the PATH tahiche Linux - Software 7 10-12-2005 12:47 PM
Finding process path praj_linux Solaris / OpenSolaris 5 12-21-2004 10:01 AM
Bash Script- Finding/Generating unique UserIDs pheasand Linux - General 2 12-11-2004 09:44 AM
Finding the kernel path blacksunshine Linux - Software 2 10-03-2004 02:45 PM
finding java path? pyropenguin Linux - Newbie 2 09-19-2002 01:02 PM


All times are GMT -5. The time now is 11:30 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration