简体   繁体   中英

How do I pipe the output of a file to a command?

I'm trying to do something a bit like:

cat my_key.pub | send_key_to_server

It led me to try experiment as such:

cat my_key.pub | echo

which produced no output.

Finally I tried:

echo "hello" | echo

which also produced no output. I would have expected it to say "hello". Why doesn't this work?

尝试

cat my_key.pub | xargs echo

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