![]() |
|
|
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 |
| HELP Required Please!!!!!!!!! | Danish Shakil | Shell Programming and Scripting | 6 | 07-30-2008 05:59 AM |
| Script required to get a required info from file. Pls. help me. | ntgobinath | Shell Programming and Scripting | 2 | 05-31-2008 09:34 AM |
| SSL help required | binums | HP-UX | 0 | 05-04-2006 03:03 AM |
| Help required on DBX | Sumanth | SUN Solaris | 1 | 07-29-2004 10:54 AM |
| help required | ruffenator | High Level Programming | 1 | 02-03-2003 11:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help Required
Below is my code which gives output like this: Every time we have to open the script file and change the value of TG in BEGIN. what i want to do is that i give two three values at the sametime and then run the script and it gives output one by one at the same time. I think i have to define some array in which those values are defined and then it gives those values to variable TG one by one. Please help... if you can provide some help for coding HTML Code:
KarachiOMP root> ./tgcmp702 DATE IN ST EN TGN ISEIZE ISATMP IANS OATMPT OVFL OSEIZE OSATMP OANS TOTUSG OOSMTCE OOS DBLSZR NTWCONG 1121 24 23 24 606 7462 7459 3573 0 0 0 0 0 55694 0 0 0 0 1122 1 0 1 606 6593 6592 2879 0 0 0 0 0 55330 0 0 0 0 1122 2 1 2 606 4000 4000 1724 0 0 0 0 0 42891 0 0 0 0 1122 3 2 3 606 542 541 248 0 0 0 0 0 11908 0 0 0 0 1122 4 3 4 606 0 0 0 0 0 0 0 0 119 0 0 0 0 1122 5 4 5 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 6 5 6 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 7 6 7 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 8 7 8 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 9 8 9 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 10 9 10 606 0 0 0 0 0 0 0 0 0 0 0 0 0 1122 11 10 11 606 1259 1257 645 0 0 0 0 0 3886 0 0 0 0 1122 12 11 12 606 6257 6243 3186 0 0 0 0 0 23033 0 0 0 0 1122 13 12 13 606 9770 9752 4980 0 0 0 0 0 38055 0 0 0 0 1122 14 13 14 606 11702 11685 5891 0 0 0 0 0 51436 0 0 0 0 1122 15 14 15 606 11609 11583 5803 0 0 0 0 0 48050 0 0 0 0 1122 16 15 16 606 11106 11075 5697 0 0 0 0 0 50772 0 0 0 0 1122 17 16 17 606 9674 9646 4808 0 0 0 0 0 41480 0 0 0 0 1122 18 17 18 606 8177 8169 4223 0 0 0 0 0 37136 0 0 0 0 1122 19 18 19 606 11609 11587 5922 0 0 0 0 0 49780 0 0 0 0 1122 20 19 20 606 11724 11722 5723 0 0 0 0 0 54494 0 0 0 0 1122 21 20 21 606 11981 11965 5722 0 0 0 0 0 53925 0 0 0 0 1122 22 21 22 606 11673 11667 5336 0 0 0 0 0 55016 0 0 0 0 1122 23 22 23 606 10351 10333 4747 0 0 0 0 0 55177 0 0 0 0
Last edited by wakhan; 11-23-2008 at 05:07 AM.. |
|
||||
|
Code:
#!/bin/ksh
for i in $@
do
nawk -v TG="$i" ' BEGIN { printf(.............).rest of nawk code'
done
each iteration of the loop wiil assign a new value to TG. No TG=something required in the BEGIN function. usage: tgcmp702 606 607 608 609 |
|
||||
|
HELP REQUIRED (Thnaks.............)
Thanks jim mcnamara!!
The code really works now according to my requirement. I have made little more change as below. #!/bin/ksh VAL='601 602 603 604 605 ....................' for i in $VAL do nawk -v TG="$i" ' BEGIN { printf(.............).rest of nawk code' done USAGE# ./tgcmp701 SIMPLE!!! Thanks ALOT!!! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|