cat , myprog.
myprog -o tmpfile input_file && cat tmpfile
- myprog - , .
, myprog (, notmyprog) , .
, - ,
myprog -o tmpfile input_file && contents=`cat tmpfile` && rm tmpfile && echo "$contents"
Saves the contents of the file in a variable so that it can be accessed after deleting the file. Note the quotes in the command argument echo. They are important for saving newlines in the file contents.
source
share