Search Results

Search: Posts Made By: freezelty
23,191
Posted By Franklin52
Use awk variables. Assuming $n and $m are shell...
Use awk variables. Assuming $n and $m are shell variables:
var=$(awk -v line="$m" -v field="$n" 'NR==line{print $field}' input_file)
23,191
Posted By posix
The avobe explanation is correct, for delimeter...
The avobe explanation is correct, for delimeter in awk use -F and use the value of "nth" filed. For runtime variable assing that variable also. using -v option.
awk -vvar=5 -F" " 'NR==10 {print...
Showing results 1 to 2 of 2

 
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy