![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Passing argument to a pl/sql block | er_ashu | Shell Programming and Scripting | 2 | 05-02-2008 08:42 AM |
| Passing more than one argument in a function | jisha | Shell Programming and Scripting | 1 | 04-23-2008 03:05 AM |
| passing argument into awk | prkfriryce | Shell Programming and Scripting | 4 | 02-01-2007 12:44 PM |
| Problem with Argument Passing | A_Rod | Shell Programming and Scripting | 4 | 09-13-2006 08:47 AM |
| Passing argument from one script to other | lloydnwo | Shell Programming and Scripting | 3 | 10-27-2005 11:06 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All,
My query is as below: Am basically writing a parser script. My input file has got some variables which are populated by the calling program. callig program: fun1("cat","dog","cow") input.* argument[1] first argument[2] second I want to write a script that should give me the result as below when executed: first="$1" second="$2" Forget about the calling function but the script i guess can be done using a for loop or a while, both am not at all comfortable with. Can some one please help me in this. Sorry for making the query so complicated. Thanks in advance JS |
| Forum Sponsor | ||
|
|
|
|||
|
Am working on the same .. I came across the below query in awk.The fir loop is mentioned here just for the logic to understand.
for(i=0;i<=6;i++) { awk '/param/ {print $2"=\"$""\"" }' a.txt > we.txt } I want the we.txt to look like first="$1" second="$2" Using my query i can print only first="$" second="$" How can i print the value of "i "inside the awk statement using the for loop or while ???? This is what i tried to explain above Thanks JS |
|
|||
|
Hello ag79,
Thanks a lot for ur time.I ran the following query for i in 1 2 3 do awk -v value_of_i=$i '/param/ {print $2"=\"$"value_of_i"\"" }' a.txt > we.txt done But this gav me the result first="$3" second="$3" third="$3" but my out put should be first="$1" second="$2" third="$3" Is this possible? Thanks JS |