Does “ - ” mean stdout in bash?

后端 未结 4 1678
迷失自我
迷失自我 2020-12-10 04:25

Is \" - \" a shortcut for stdout in bash? If not what does it mean? For example,

wget -q -O - $line 

How about stdin?

Thanks and re

4条回答
  •  佛祖请我去吃肉
    2020-12-10 05:00

    It depends on the program. Ususally, - means "send to the output".

    Use read:

    #!/bin/bash
    
    echo -n "What's your name? "
    read var1
    echo "hello $var1"
    

提交回复
热议问题