![]() |
|
|
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 |
| Compare two arrays in sh or compare two fields | rijeshpp | Shell Programming and Scripting | 0 | 10-31-2007 02:47 AM |
| compare two tar.bz2 | JCR | Shell Programming and Scripting | 2 | 07-30-2007 12:16 PM |
| compare grep? | k@ssidy | UNIX for Dummies Questions & Answers | 7 | 06-15-2005 12:59 PM |
| LPP Compare | Smoker | AIX | 2 | 06-09-2005 02:43 PM |
| Compare | Syed_45 | UNIX for Dummies Questions & Answers | 2 | 08-20-2001 04:53 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to compare it ??
Hi how do you compare it in ksh
ALINES=$(cat AFILE | wc -l) BFIRST=$(head -1 BFILE) I got ALINES=9 and BFRIST=records'9' I want 9=9 , how do you write BLINES=9 from records'9' so I can say ALINES==BLINES Thanks |
|
||||
|
Quote:
Code:
ALINES=$(cat AFILE | wc -l)
BFIRST=$(head -1 BFILE)
BFIRST_NUMBER=`awk -F"'" '{ print $2 }' BFRIST`
then BFIRST_NUMBER will have 9
|
|
||||
|
It is not working
+ + wc -l + cat A ALINES= 9 + + head -1 B BFIRST=records='9' + + awk -F' { print $2 } BFIRST awk: 0602-533 Cannot find or open file BFIRST. The source line number is 1. BLINES= + print BLINES BLINES + (( ALINES == BLINES )) t3[7]: ALINES == BLINES : 0403-009 The specified number is not valid for this command. BFIRST is not a FILE ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|