tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: hiding sh stderr



    Date:        Sun, 13 May 2018 17:04:02 +0000
    From:        coypu%sdf.org@localhost
    Message-ID:  <20180513170401.GA11733%SDF.ORG@localhost>

  | (I'd like to apply PR 52684 but this is making it annoying)

For that, either ...

	ans="$({ pkg info -qI "$i" ;} 2> /dev/null)"
or
	{ ans="$(pkg info -qI "$i")" ; } 2>/dev/null

(Those should work in any shell.)

You'd think that perhaps just

	ans="$(pkg info -qI "$i") 2>/dev/null

might work, but it won't anywhere, as the order of performing
redirects and assignments isn't what you'd hope for there.

kre



Home | Main Index | Thread Index | Old Index