On 10/08/14 17:15, Reco wrote: > Hi. > > On Sun, 10 Aug 2014 17:03:20 +0200 > Tony van der Hoff <t...@vanderhoff.org> wrote: > >> DEBUG=1 >> if [ $DEBUG -eq 0 ]; then >> NULLOUT='>/dev/null' >> fi >> pushd $dir ${NULLOUT}; do_something; popd ${NULLOUT} >> > > Try it like this: > > #DEBUG=1 > OUT=/dev/null > [ -z "$DEBUG" ] && OUT=/dev/stdout > > pushd $dir > $OUT; do_something; popd > $OUT > > Reco > >
Thanks Reco, that works (or at least a variant more in my style). I'm a bit surprised that pushd/popd don't have an option to suppress the output, but there we go... Thanks again. -- 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/53e8a52b.2080...@vanderhoff.org