Awkk's -v
argument takes a name=value
pair, allowing you to use name
as a variable inside your awk program. So
tt() { r=$(j | awk -v id="$2" 'FNR=id && NR {print $1}'); jj $r; }
(TBH I'm not sure why the && NR
is necessary here, or why you're distinguishing between NR
and FNR
when you are only passing a single input (stdin) to awk.)