Hello,
I have a problem with passing arguments for awk.
I set a variable C as charecter (or string). Then put that variable as argument for awk.
Unfortuanatly, I go not get the needed result.
For example, in this example, I get the content of the file but I expect it write "g" as many lines as file file coran.pls contains
any input will help
[adel@localhost ~]$ C=g
[adel@localhost ~]$ awk -v c=$C '{ print $c }' coran.pls
[playlist]
NumberOfEntries=10
File1=/home/adel/coran/105.mp3
File2=/home/adel/coran/106.mp3
File3=/home/adel/coran/107.mp3
File4=/home/adel/coran/108.mp3
File5=/home/adel/coran/109.mp3
File6=/home/adel/coran/110.mp3
File7=/home/adel/coran/111.mp3
File8=/home/adel/coran/112.mp3
File9=/home/adel/coran/113.mp3
File10=/home/adel/coran/114.mp3
--
PhD candidate in Computer Science
Address
3 avenue lamine, cité ezzahra, Sousse 4000
Tunisia
tel: +216 97 246 706 (+33640302046 jusqu'au 15/6)
fax: +216 71 391 166
I have a problem with passing arguments for awk.
I set a variable C as charecter (or string). Then put that variable as argument for awk.
Unfortuanatly, I go not get the needed result.
For example, in this example, I get the content of the file but I expect it write "g" as many lines as file file coran.pls contains
any input will help
[adel@localhost ~]$ C=g
[adel@localhost ~]$ awk -v c=$C '{ print $c }' coran.pls
[playlist]
NumberOfEntries=10
File1=/home/adel/coran/105.mp3
File2=/home/adel/coran/106.mp3
File3=/home/adel/coran/107.mp3
File4=/home/adel/coran/108.mp3
File5=/home/adel/coran/109.mp3
File6=/home/adel/coran/110.mp3
File7=/home/adel/coran/111.mp3
File8=/home/adel/coran/112.mp3
File9=/home/adel/coran/113.mp3
File10=/home/adel/coran/114.mp3
--
PhD candidate in Computer Science
Address
3 avenue lamine, cité ezzahra, Sousse 4000
Tunisia
tel: +216 97 246 706 (+33640302046 jusqu'au 15/6)
fax: +216 71 391 166
-- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines