![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix file operations(shell script) | nivas | Shell Programming and Scripting | 6 | 02-07-2008 04:11 AM |
| File operations | monks | UNIX for Dummies Questions & Answers | 2 | 04-26-2006 04:26 AM |
| File operations | chiragmistry21 | Shell Programming and Scripting | 2 | 03-27-2006 02:00 PM |
| where i can find list of UNIX commands for daily operations ? | mgoutham | UNIX Desktop for Dummies Questions & Answers | 1 | 03-02-2006 11:35 AM |
| mathematics operations in unix | cesar720213 | UNIX for Dummies Questions & Answers | 2 | 11-22-2001 08:24 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#15
|
|||
|
|||
|
Try this..
Ok.. Now I got your requirement.
Try below shell script.. #! /bin/ksh #set -vx INFILE1=$1 INFILE2=$2 OUTFILE=/tmp/outfil.dat cat $INFILE1 | while read line do cat $INFILE2 | while read line1 do echo $line wrd=`echo $line1 | cut -c1-24` if [ $line = $wrd ]; then echo $line1 >> $OUTFILE fi done done ====================================================== $cat f1.dat QWERTYUI098765432112345 QWIUYTUI098765432112345 CDXRTYUI098765432112345 $cat f2.dat QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 AAQAAAAAAAAAAAAAAAAAAAA abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 $ $comp.ksh f1.dat f2.dat $view /tmp/outfil.dat QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 QWERTYUI098765432112345 abc@soft.com 2007-09-260012275.80 0000924 00245.00 2007- 10-25ASDFRESS,POIU S 000000000000015.52 000000000000000.00 CBB00010000000906 |
|||
| Google The UNIX and Linux Forums |
| Forum Sponsor | ||
|
|