Don't display pushd/popd stack across several bash scripts (quiet pushd/popd)

前端 未结 3 1677
野性不改
野性不改 2020-12-29 00:45

Each time I use pushd or popd, it print the stack to standard output. How not to do so?

I don\'t want to do pushd > /dev/null each time because I hav

相关标签:
3条回答
  • 2020-12-29 01:09

    In zsh you can setopt PUSHDSILENT. Put this in your ~/.zshrc.

    0 讨论(0)
  • 2020-12-29 01:13

    You could add

    pushd () {
        command pushd "$@" > /dev/null
    }
    
    popd () {
        command popd "$@" > /dev/null
    }
    

    to the top of each script. This is probably the minimum amount of work it will take to solve your problem.

    0 讨论(0)
  • 2020-12-29 01:14

    In your .profile file (what ever it is called in your system) add:

    pushd () {
        command pushd "$@" > /dev/null
    }
    
    popd () {
        command popd "$@" > /dev/null
    }
    
    export pushd popd
    
    0 讨论(0)
提交回复
热议问题