Jasmin shahrzad
asked on
awk to variable in bash
What i do wrong here with this command
i sat (in linux)
new=test
den i have test.log files. when i say NR==30 {print $1; exit}' $new.log from command line
get successfully first variable which is 2. but in bash file want to put this number in variable say
err=awk 'NR==30 {print $1; exit}' $new.log
get field NR==30 {print $1; exit}: command not found
i sat (in linux)
new=test
den i have test.log files. when i say NR==30 {print $1; exit}' $new.log from command line
get successfully first variable which is 2. but in bash file want to put this number in variable say
err=awk 'NR==30 {print $1; exit}' $new.log
get field NR==30 {print $1; exit}: command not found
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The $(...) form has superseded backticks for command substitution, the backticks still work, however.
See this article for a comprehensive explanation:
http://tldp.org/LDP/abs/html/commandsub.html