How can I write into a file the output of a command but also include the command at the beginning of a file?
eg:
grep -nrs 'blah' . >/home/ca/out.txt
so that the file shows
grep -nrs 'blah' . >/home/ca/out.txt
./something.cpp:1329: if(blah)
to leave a blank line between?
grep -nrs 'blah' . >/home/ca/out.txt
./something.cpp:1329: if(blah)
....
Thank you
script- I love that command, but haven't used it for years; and if you don't remember the name, hard to do anaproposto find it.