• 0 Posts
  • 2 Comments
Joined 8 months ago
cake
Cake day: July 2nd, 2025

help-circle

  • 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.​​​​​​​​​​​​​​​​