![]() |
|
|
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 |
| FTP and run a loop for array problem | tuffgong2008 | Shell Programming and Scripting | 3 | 12-19-2008 04:56 PM |
| Reading from while loop into an array | ssuresh1999 | UNIX for Dummies Questions & Answers | 2 | 08-12-2008 12:53 PM |
| Array in loop is acting up | RisingSun | Shell Programming and Scripting | 5 | 08-07-2008 03:21 PM |
| How to use array values after the loop. | Devesh5683 | Shell Programming and Scripting | 1 | 05-13-2008 08:38 PM |
| Array Declaration and For Loop | 33junaid | Shell Programming and Scripting | 4 | 09-15-2007 05:16 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi everyone
![]() I have 2 files - IN & OUT. Example: IN A:13:30 B:45:40 . . . UNLIMITED OUT Z:12:24 Y:20:15 . . . UNLIMITED I want first row of numbers of IN - OUT. Example 13-12 45-20 My code is #!/bin/csh -f set y=1 while ( $y<UNLIMITED ) set in = `awk -F':' '{print $2}' IN |awk '{array[NR]=$0} END {print array[y];}'` set out = `awk -F':' '{print $2}' OUT |awk '{array[NR]=$0} END {print array[y];}'` set number = `expr $in - $out` echo "$number" @ y = $y + 1 end expr: syntax error expr: syntax error expr: syntax error expr: syntax error expr: syntax error expr: syntax error all is expr: syntax error I tried to solve more than one day already. And also duno wat should i write instead of UNLIMITED.Anyone can help me? |
|
||||
|
As a starting point, you may want to review the following, AWK program
Files are read into a two-dimensional array and then processed for printing. The original query was to extract the 5th column from multiple files and print them out in columnar format. |
|
|||||
|
Quote:
Quote:
csh is not recommended for scripting.Top Ten Reasons not to use the C shell Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|