Hi,

In my shell (bash) scripts, I occasionally use pushd/popd to descend
into subdirectories;

pushd $dir; do_something; popd

Unfortunately the pushd/popd generate a lot of (mostly) unwanted output,
with no apparent way of suppressing it.
So, my solution is:

pushd $dir >/dev/null; do_something; popd >/dev/null

which has the desired effect, but for debugging, it's useful to
re-enable the output.

I tried, and failed, this:

DEBUG=1
if [ $DEBUG -eq 0 ]; then
        NULLOUT='>/dev/null'
fi
pushd $dir ${NULLOUT}; do_something; popd ${NULLOUT}

The $NULLOUT is totally ineffective.

Any suggestions as to why this might be so?

-- 
Tony van der Hoff  | mailto:t...@vanderhoff.org
Ariège, France     |


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/53e789b8.4020...@vanderhoff.org

Reply via email to