couldn\'t find this on SO. I ran the following command in the terminal:
>> grep -Rl \"curl\" ./
and this displays the list of files wher
Piping to 'wc' could be better IF the last line ends with a newline (I know that in this case, it will)
However, if the last line does not end with a newline 'wc -l' gives back a false result.
For example:
$ echo "asd" | wc -l
Will return 1
and
$ echo -n "asd" | wc -l
Will return 0
So what I often use is grep
$ echo "asd" | grep "^.*$" -c
1
$ echo -n "asd" | grep "^.*$" -c
1
This is closer to reality than what wc -l
will return.