trash
fedilink
@thann@heapoverflow.ml
mod
link
fedilink
1
edit-2
4M

tee is useful for sending stdin to a file AND stdout, if you want to just write to a file you can do:

cat <<EOF > /tmp/file_to_write
stuff $VAR etc
EOF

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 =\

Ask specific questions about how to code something in sh, bash, zsh, etc

General bash discussion on lemmy.ml

Create Post From:
lemmy.ml

  • 0 users online
  • 2 users / day
  • 2 users / week
  • 2 users / month
  • 5 users / 6 months
  • 19 subscribers
  • 10 Posts
  • 18 Comments
  • Modlog