RE: awk im script
Hallo Goran,
Thomas Hühn schrieb:
>Wie wärs damit?
>
>|-v var=val
>|--assign var=val
>| Assign the value val to the variable var, before execution of
>| the program begins. Such variable values are available to the
>| BEGIN block of an AWK program.
Genauso, laß dann nur noch das falsche "\" Zeichen und das überflüssige "$"
Zeichen weg, dann geht?s.
Falsch:
awk '{print \$$spaltenzah}' $file > /tmp/$$
Richtig:
awk -v spaltenzahl=3 '{print $spaltenzahl}' $file > /tmp/$$
Gruß
[André]
Reply to: