In bash
, I can do:
cat >a.txt <<EOF
line 1111
line 2222
EOF
But this is invalid syntax when using in fish
. What's the correct way to do it?
You can use echo and a multiline string (adapted from this thread in the fish issue tracker)
echo >a.txt "\
line 1111
line 2222"
FWIW in the console/terminal I have always used:
cat > a.txt
line 1111
line 2222
Ctrl+D
It worked both in Bash and Fish.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With