![]() |
|
|
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 |
| trim spaces in a file | badrimohanty | Shell Programming and Scripting | 7 | 06-22-2009 02:53 PM |
| eliminate pathname from the file name in the o/p | ss_ss | Shell Programming and Scripting | 2 | 02-24-2009 02:31 AM |
| How to trim a 419th column in UNIX file. | Amit.Sagpariya | Shell Programming and Scripting | 4 | 01-14-2009 02:09 AM |
| trim file | tungaw2004 | UNIX for Dummies Questions & Answers | 1 | 09-15-2007 07:05 AM |
| trim file name extension???? | vishal_ranjan | AIX | 1 | 07-31-2007 10:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Trim pathname of the file
I am capturing the files in a directory to an array. I have 2 arrays with list of files in two different directories. Both the directories are supposed to have the same number of files and filenames.
I want to check that the same file exists in both the directories. After I capture the filenames in Array, I see that the file names are captured along with their pathname. So when I compare the filenames, I think the system takes the pathname into account and fails the match. Here is what I have: dir1 = aa/bb/cc/dd/ee dir2 = xx/yy/ww/uu/vv/zz/tt/ss array1=($(find "$dir1" -name "out_*" | sort -n)) array2=($(find "$dir2" -name "out_*" | sort -n)) Output looks like: Array1 = aa/bb/cc/dd/ee/out_abcd.txt Array2 = xx/yy/ww/uu/vv/zz/tt/ss/out_abcd.txt When comparing these outputs I get error. Any help would be appreciated. Thanks! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|