tee is useful for sending stdin to a file AND stdout, if you want to just write to a file you can do:
tee
cat <<EOF > /tmp/file_to_write stuff $VAR etc EOF
EDIT: to append use this top line: cat <<EOF >> /tmp/file_to_write (double >)
cat <<EOF >> /tmp/file_to_write
this: <<EOF is called a “here-doc”, and variable interpolation works in it =\
<<EOF
Ask specific questions about how to code something in sh, bash, zsh, etc
General bash discussion on lemmy.ml
Create Post From: lemmy.ml
tee
is useful for sending stdin to a file AND stdout, if you want to just write to a file you can do:EDIT: to append use this top line:
cat <<EOF >> /tmp/file_to_write
(double >)this:
<<EOF
is called a “here-doc”, and variable interpolation works in it =\