I'm translating a csh script to bash an came across a line that looks like
@ lines = `grep num_lines ../config.txt | awk '{printf("%d",int($2))}' `
What does the '@' do here? I found some documentation stating that csh uses '@' for expressions. However, this looks like a normal variable assignment to me. When I run the grep and awk part of the code in bash the output is an integer with a preceding '%d', e.g. '%d 12045'.
awk
command saysprint
and notprintf
? – Scott - Слава Україні May 11 '19 at 04:26Ambiguous
error. (orExpression Syntax
intcsh
). – May 11 '19 at 05:53grep
. Uselines=$(awk '/num_lines/ {print $2}' ../config.txt)
or evenlines=$(awk '$1=="num_lines" {print $2}' ../config.txt)
– Chris Davies May 12 '19 at 19:17