I have this two step bash command:
L=`wc -l testfile | cut -d' ' -f1`
myprogram testfile $L testfile.out
Long story short, myprogram
needs the line count as an input.
I want to combine this into one line.
This does not work because using redirect |
to -
passes stdout stream as a file, not a string.
wc -l testfile | cut -d' ' -f1 | myprogram testfile - testfile.out
Is there a way to combine this into one line?