简体   繁体   中英

How do I redirect a string in 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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM