Shell Script: How to write a string to file and to stdout on console?
You can use >>
to print in another file.
echo "hello" >> logfile.txt
Use the tee
command:
echo "hello" | tee logfile.txt
You can use >>
to print in another file.
echo "hello" >> logfile.txt
Use the tee
command:
echo "hello" | tee logfile.txt