How to hide command output in Bash

后端 未结 7 1410
天涯浪人
天涯浪人 2020-12-02 05:42

I want to make my Bash scripts more elegant for the end user. How do I hide the output when Bash is executing commands?

For example, when Bash executes



        
7条回答
  •  再見小時候
    2020-12-02 05:55

    You should not use bash in this case to get rid of the output. Yum does have an option -q which suppresses the output.

    You'll most certainly also want to use -y

    echo "Installing nano..."
    yum -y -q install nano
    

    To see all the options for yum, use man yum.

提交回复
热议问题