![]() |
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 |
| Help with Korn Shell Scripting | th0123 | UNIX for Dummies Questions & Answers | 2 | 04-18-2008 03:06 AM |
| practice tests- Unix Korn Shell Scripting | eswasas | UNIX for Dummies Questions & Answers | 0 | 02-14-2007 12:40 PM |
| Online UNIX emulator for Korn Shell scripting | eswasas | UNIX for Dummies Questions & Answers | 1 | 02-01-2007 04:46 PM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 09:12 AM |
| file activity (open/closed) file descriptor info using KORN shell scripting | Gary Dunn | UNIX for Dummies Questions & Answers | 3 | 06-07-2004 02:54 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Repost-Korn Shell Scripting
Hi, being very new to Korn Shell Scripting I am hoping that someone here can help me. I want to compare file name in scp/inbox directory to file name stored inside a file in pnt/compare directory.
Hi, being very new to Korn Shell Scripting I am hoping that someone here can help me. I want to compare file name in scp/inbox directory to file name stored inside a file in pnt/compare directory. 1. Copy the first file name from the scp/inbox directory and insert into the pntcompare.dat. Then exit program. 2. Otherwise, if there is a file name pntcompare.dat in /pnt/compare directory then capture the first file name from the scp/inbox directory and compare to the file name’s information stored inside the pntcompare.dat in /pnt/compare directory. 3. If they matched then remove the current file from the /scp/inbox directory to pnt/badfiles directory 4. Then create a badpnt.dat file and store the record information from file in /scp/inbox directory.. 5. Next, remove the pntcompare.dat file from /pnt/compare directory. 6. Also remove the touch file (inputloop.touch) from Home directory. 7. If they not matched then remove contents in the pntcompare.dat then exit. Here is an example of the file name pnt.20070327083828.000000066 Here is what I can come up so far, please help. file=`/$ROOTDIR/pnt/compare -name 'pntcompare.dat' -print` if [ -z $file ] then pntcnt=`ls -l /$ROOTDIR/scp/inbox | grep "PNT." | wc -l` if [[ $pntcnt1 -gt 0 ]] then ls /$ROOTDIR/scp/inbox | grep "PNT." > /$ROOTDIR/pnt/compare/pntcompare.dat pntcnt=`wc -l /$ROOTDIR/scp/inbox/pntcompare.dat|awk '{print $1}` curcnt=1 do filename=`head -$curcnt /$ROOTDIR/pnt/compare/pntcompare.dat | tail -1` exit else Please help!!! Thanks |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|