this post was submitted on 13 Feb 2026
78 points (88.2% liked)

Futurology

4068 readers
376 users here now

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] oktoberpaard@piefed.social 6 points 1 day ago

I agree that comments like this are just hype. However, this is what Claude responded first try when I asked it your question verbatim:

Fish doesn’t support the <<EOF heredoc syntax — that’s a Bash/POSIX feature. Here are your options in Fish: Use printf or echo:

printf '%s\n' \
  'line 1' \
  'line 2' \
  'line 3' > notes.txt

Use begin/end with a string:

echo "line 1
line 2
line 3" > notes.txt

Use string with multiline input:

string collect -- "line 1
line 2
line 3" > notes.txt

Or just call bash inline for a one-off heredoc:

bash -c 'cat <<EOF > notes.txt
line 1
line 2
line 3
EOF'

The printf approach is generally the most idiomatic Fish way to do it.​​​​​​​​​​​​​​​​