next up previous contents
Next: To input from the Up: Input/Output Previous: To output to the   Contents

To output to a file

Use the echo command but redirect the output

echo "Hello world!" > myfile

This creates, or replaces, the file ``myfile'' with that famous one liner. If you want to append to a file rather than replace it:-

echo "Goodbye cruel world!" » myfile



P.D. Gronbech (IT Staff) 2015-10-02