Let say I have the program:
Calculate.py
Is there a unix command-line that counts the number of lines outputted from my program, Calculate.py?
command linegrepshell
Let say I have the program:
Calculate.py
Is there a unix command-line that counts the number of lines outputted from my program, Calculate.py?
Best Answer
You can pipe the output in to
wc
. You can use the-l
flag to count lines. Run the program normally and use a pipe to redirect towc.
Alternatively, you can redirect the output of your program to a file, say
calc.out
, and runwc
on that file.