![]() |
passing vars to awk
hi lq, i have this bash script, how do i pass the bash variable to the awk command? :
Code:
/temp> cat test.ksh |
Hi,
use -v name="$var" directly after the (n)awk command. I.e: Code:
#!/bin/kshCode:
$ ./test.ksh test.lst worldHope this helps. |
Another point, it is unwise to name .ksh as extension to a bash script.
|
thanks druuna, it works magically.
thanks for the advice jll. (bad habit i suppose). |
Re: passing vars to awk
[QUOTE]Originally posted by schneidz
[B]hi lq, i have this bash script, how do i pass the bash variable to the awk command? : /quote] By using quoting sensibly: ;) Code:
#!/bin/bash |
should be
Code:
if('$2' == '$cycle') |
Quote:
|
| All times are GMT -5. The time now is 10:28 PM. |