![]() |
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 |
| find full directory and delete old dated file? | xramm | Shell Programming and Scripting | 2 | 07-07-2007 10:56 AM |
| getting full path from relative path | polypus | Shell Programming and Scripting | 4 | 03-25-2007 01:08 PM |
| list all files with full path of the file | Sowser | UNIX for Advanced & Expert Users | 4 | 02-13-2007 05:46 PM |
| process executable file full path | xtrix | UNIX for Advanced & Expert Users | 3 | 10-11-2004 05:28 AM |
| extract only file name from full path file name | sanjay92 | UNIX for Dummies Questions & Answers | 2 | 10-02-2001 09:49 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
to find the file with full path
Hi,
I have written this shell script: fl=`ls -1lrt $mylist | grep '\.xml$' | awk '{print $9}'` echo $fl (1) for i in $fl do for dir in $mylist do if [ -f $dir/$i ] then echo $dir/$i >> tmp (2) fi done done The mylist contains some directory names. The satement (1) gives the sorted list of files from multiple directories. the satement (2) lists the same files with their full path. But here I get some duplicate lines in tmp file when two files with same name in different directories. Due to some condition I have no clue to remove the duplicate entries bcoz it is unknown that which entry should be removed. The above script works fine if there is no multiple file ahving same name. I have written the above code to find the list of files from multiple directories which are sorted by the time of their creation irrespective of directories. so please tell is there any other way to do the same thing. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|