![]() |
|
|
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 |
| Assign o/p of awk to a variable | c2b2 | Shell Programming and Scripting | 8 | 04-01-2009 08:50 AM |
| assign a value to a variable | Shivdatta | Shell Programming and Scripting | 10 | 01-17-2007 07:40 AM |
| assign value to variable using AWK | HAA | Shell Programming and Scripting | 4 | 12-06-2006 11:43 AM |
| assign a value to variable | markjason | Shell Programming and Scripting | 3 | 10-10-2006 03:05 PM |
| assign to variable | AkumaTay | UNIX for Dummies Questions & Answers | 1 | 05-18-2002 03:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi
The next script campares two files File1-Line1 vs File2-Line1, File1-Line1 vs File2-Line2... only if line contains "AS-", if LineX is not in File2 writes in aux, but "valor" is allways=1 never changes! What is wrong?valor changes to 0 before break, after brake is again 1 #!/bin/ksh echo > aux while read label do valor=1 echo $label | grep "AS-" if [ $? -eq 0 ] then while read labelold do if [ "${label}" = "${labelold}" ] then #echo "encon" >aux2 valor=0 echo $valor break fi echo $valor #<--- Allways is 1 done < hosts.old if [$valor -eq 1] then echo "$label" >> aux fi fi done < hosts Last edited by agustincm; 10-12-2006 at 01:44 PM.. Reason: more info |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|