Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Fish equivalent for <<EOF in Bash

Tags:

bash

shell

fish

What is the Fish equivalent for << in Bash, as in

$ nc localhost 8888 << EOF
> foo
> EOF

In Fish, it crashes

> nc localhost 8888 << EOF
fish: Expected redirection specification, got token of type 'Redirect input to file'
nc localhost 8888 << EOF
               ^
like image 731
Bartosz Marcinkowski Avatar asked May 20 '15 18:05

Bartosz Marcinkowski


2 Answers

Thanks to the link provided by Etan I found out that such feature is not implemented, and the closest thing available is

> echo "\
  foo
  " | nc localhost 8888
like image 180
Bartosz Marcinkowski Avatar answered Oct 19 '22 01:10

Bartosz Marcinkowski


That is not implemented in Fish. You can read about Bash/Fish syntax crossovers HERE.

like image 29
Foggzie Avatar answered Oct 19 '22 00:10

Foggzie