From: Hallvard B Furuseth on 15 Dec 2009 05:19 Stephane CHAZELAS writes: >2009-12-14, 17:20(+00), Icarus Sparry: >> So hopefully >> test -z "${DISUTILE_DEBUG+yes} && unset DISTUTILS_DEBUG >> will fix your problem. >> (...) > > The common way to make a command immune to set -e is to write > it: > > unset DISTUTILS_DEBUG || : OK If the unset fails, that'll likely make noise on stderr. Redirecting stderr from builtins may not work, and putting it in a subshell cancels the effect but does yield an exit status, so: (unset DISTUTILS_DEBUG) >/dev/null 2>&1 && unset DISTUTILS_DEBUG Though Icarus' version looks simpler in this case. -- Hallvard
From: Hallvard B Furuseth on 15 Dec 2009 08:53 Another followup-to-self: >Stephane CHAZELAS writes: >>2009-12-14, 17:20(+00), Icarus Sparry: >>> So hopefully >>> test -z "${DISUTILE_DEBUG+yes} && unset DISTUTILS_DEBUG >>> will fix your problem. >>> (...) Or test -n "${DISTUTILE_DEBUG+yes}" || unset DISTUTILS_DEBUG if the point was to make sh -e happy. Same with mine, which still needed the '|| : OK' at the end: >> The common way to make a command immune to set -e is to write >> it: >> >> unset DISTUTILS_DEBUG || : OK >(...) > (unset DISTUTILS_DEBUG) >/dev/null 2>&1 && unset DISTUTILS_DEBUG -- Hallvard
From: Stephane CHAZELAS on 15 Dec 2009 14:24 2009-12-15, 11:19(+01), Hallvard B Furuseth: > Stephane CHAZELAS writes: >>2009-12-14, 17:20(+00), Icarus Sparry: >>> So hopefully >>> test -z "${DISUTILE_DEBUG+yes} && unset DISTUTILS_DEBUG >>> will fix your problem. >>> (...) >> >> The common way to make a command immune to set -e is to write >> it: >> >> unset DISTUTILS_DEBUG || : OK > > If the unset fails, that'll likely make noise on stderr. Not in the case of bash prior to 2.05b discussed here though. > Redirecting stderr from builtins may not work I don't know of any POSIX shell where that doesn't work. Some versions of the Bourne shell are known to have that kind of issue. Sven will certainly have more details ;) > and putting it in > a subshell cancels the effect but does yield an exit status, so: > > (unset DISTUTILS_DEBUG) >/dev/null 2>&1 && unset DISTUTILS_DEBUG > > Though Icarus' version looks simpler in this case. You could also do ${DISTUTILS_DEBUG+unset DISTUTILS_DEBUG} which will not work in the Bourne shell and depends on $IFS in zsh in sh emulation. eval "${DISTUTILS_DEBUG+unset DISTUTILS_DEBUG}" should work though. -- St�phane
From: OldSchool on 15 Dec 2009 15:22 On Dec 14, 5:01 pm, Dave <f...(a)coo.com> wrote: > Stephane CHAZELAS wrote: > > 2009-12-14, 17:05(+00), Dave: > > That was fixed in bash-2.05b-beta1. 2.05b was released in 2002. > > The latest version of bash is 4.0.35. You may want to consider > > upgrading. > > I could easily upgrade - in fact, there is a later version someone else built on > the machine. > > But it does no harm to find out issues that arise as a result of using older > versions of software. The release of HP-UX is quite old, but it is the latest > which will work on the PA-RISC processor. The newer releases only work on Itanium. >
From: OldSchool on 15 Dec 2009 15:25 On Dec 15, 3:22 pm, OldSchool <scott.my...(a)macys.com> wrote: > On Dec 14, 5:01 pm, Dave <f...(a)coo.com> wrote: > > > > > Stephane CHAZELAS wrote: > > > 2009-12-14, 17:05(+00), Dave: > > > That was fixed in bash-2.05b-beta1. 2.05b was released in 2002. > > > The latest version of bash is 4.0.35. You may want to consider > > > upgrading. > > > I could easily upgrade - in fact, there is a later version someone else built on > > the machine. > > > But it does no harm to find out issues that arise as a result of using older > > versions of software. The release of HP-UX is quite old, but it is the latest > > which will work on the PA-RISC processor. The newer releases only work on Itanium.- Hide quoted text - > > - Show quoted text - didn't mean to send the previous..... I don't know if you missed the point, but its NOT related to the release of HPUX. Its the release of bash, which is a totally separate animal. You should be able to build the latest from source if you can't scrounge up a pre-built binary.
First
|
Prev
|
Pages: 1 2 3 Prev: The select builtin and white space Next: Textfile with unwanted spaces in words |