![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Missing core file using ssh + command | kclittle | UNIX for Advanced & Expert Users | 5 | 03-26-2008 05:36 PM |
| Urgent: How can i get the missing records from one file out of two | Shiv@jad | UNIX for Advanced & Expert Users | 1 | 10-10-2007 03:43 PM |
| finding duplicate files by size and finding pattern matching and its count | jerome Sukumar | Shell Programming and Scripting | 2 | 12-01-2006 04:20 AM |
| File descriptors missing on startup | xnightcrawl | UNIX for Advanced & Expert Users | 1 | 12-23-2005 12:58 PM |
| core file missing part of call stack | Lazzar | AIX | 1 | 07-29-2005 07:50 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Finding which file is missing
I was hoping someone ould help me with the following.
I have 2 files in a directory FILEA and FILEB. i am running a process on these 2 files but before the process can run both FILEA and FILEB need to be present. If one or both the files are missing i need to know what file(s) is(are) missing. I am not entirely sure how to go about this problem with out using the 'test' command several nested if statements... i am sure there must be a better solution could anyone assist. Thanks for your help. |
|
||||
|
What's the problem with doing nested if ?
Code:
if [ ! -f $FILEA ]
then
if [ ! -f $FILEB ]
then
echo "Neither file exists"
else
echo "File A does not exist but file B does"
fi
else
if [ ! -f $FILEB ]
then
echo "File A exists but file B does not"
fi
fi
|
|
||||
|
I was hoping someone could expand on this for me as it could be useful.
How would you do teh below but for different file names. i.e. say on one day FILEA.TXT is called filea.txt, or FiLeA.tXT or even fIlEa.TxT. Say the case case changes but not the file name. so if the file being checked was always the same name but differed only it uppercase or lowercase how could you do a seach so file would be picked up irrespective of the case |
|
||||
|
could you give me an example as my skills are pretty poor
have chacked man tr but am confused as to how i would use to process a file irrelevant of its case... Plus tr only appears to accept input from stdin but in above example the inputs will be filea and fileb so am even more confused any help |
|
|||||
|
Code:
> file1="AbCdEf" > file1a=$(echo "$file1" | tr [A-Z] [a-z]) > echo $file1a abcdef |
![]() |
| Bookmarks |
| Tags |
| linux, solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|