![]() |
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 |
| grep -A switch not working correctly with -m | zer0 | UNIX for Dummies Questions & Answers | 2 | 06-19-2008 06:26 AM |
| Is grep being used correctly? | sai0899 | Shell Programming and Scripting | 2 | 04-18-2008 12:03 AM |
| HP-UX will not boot correctly | pantas manik | HP-UX | 1 | 05-30-2006 02:51 AM |
| fixing the error message when grep doesn't finds the pattern. | silver123 | UNIX for Dummies Questions & Answers | 1 | 03-03-2006 05:59 AM |
| grep error message | gammaman | UNIX for Dummies Questions & Answers | 3 | 07-10-2005 11:58 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Grep/awk not getting the message correctly
I have a script which will take two file as the inputs and take the Value in file1 and search in file2 and give the output in Outputfile.
#!/bin/sh #. ${HOME}/crossworlds/bin/CWSharedEnv.sh FILE1=$1 FILE2=$2 for Var in $(cat $FILE1);do echo $Var grep -i "$Var" $FILE2 done > Outputfile I have tried awk "/$Var/" $FILE2 instead of grep -i "$Var" $FILE2.But gives the same results. My File2 contains lines with Japanese characters. But the problem here is the Outfputile shows some lines with 1004 bytes and some lines correctly. For more clarity I have attached the files FILE1,FILE2 and Outputfile. To view the Japanese characters correctly you have to use texpad that is Unicode enabled and rightclick and goto properties change the font to unicode japanese. For the same lines length in File1 is different from Outputfile. Can anyone explain me what is the problem here and the solution for the same? |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|