Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I redirect a string in Fish?

Tags:

fish

I want to redirect a string into the STDIN of a command.

I would do it using something like cmd <<< "my string" in Bash, or even cmd <<EOF ... EOF. But I can't seem to do either in Fish. What am I supposed to do here? Are pipes the only way?

like image 437
cflewis Avatar asked Jul 30 '14 17:07

cflewis


People also ask

How do I change the prompt in fish?

The "prompt" tab displays the contents of the current fish shell prompt. It allows selection from 17 predefined prompts. To change the prompt, select one and press "Prompt Set!".

What is fish command?

fish is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required.

How do fish export variables?

To give a variable to an external command, it needs to be “exported”. Unlike other shells, fish does not have an export command. Instead, a variable is exported via an option to set , either --export or just -x .


1 Answers

Yes, you would use pipes for this, e.g. echo "my string" | cmd. fish has no equivalent to the <<< operator in bash.

like image 199
ridiculous_fish Avatar answered Oct 23 '22 11:10

ridiculous_fish