With bash, we had the possibility to read multilines from stdin like this cat << END
. When I try the same command from the fish shell, I get this error Expected a string, but instead found a redirection
.
Is there a way to read from stdin with the fish shell ??!!
"Heredocs", which are the feature you are referring to, are not in fish. This is because their main function is
cat <<END
some
multiline
string
END
, which can be replicated by just using echo
with a multiline literal, like
echo "some
multiline
string"
or printf "%s\n"
with one argument per line, like
printf "%s\n" "some" "multiline" "string"
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