[cfe-dev] 'sw_vers' on Linux

Bob Wilson bob.wilson at apple.com
Tue Apr 30 10:07:54 PDT 2013


On Apr 28, 2013, at 10:56 PM, Csaba Raduly <rcsaba at gmail.com> wrote:

> Hi all,
> 
> On Fri, Apr 26, 2013 at 7:18 PM, John Smith  wrote:
>> On Fri, Apr 26, 2013 at 7:05 PM, Bob Wilson  wrote:
>>> 
>>> Does the version of "which" on Linux and BSD support the -s (silent) option?  That would be slightly cleaner than redirecting to /dev/null.
>>> 
>> Gnu '/usr/bin/which' on my Fedora 17 system does not. But why worry
>> about possibly non-portable options like '-s', when ">/dev/null 2&1"
>> will work on all *nix flavors ?
> 
> Just FYI: Solaris 'which' writes its error message to stdout ("No
> sw_vers found in ..."), instead of writing nothing to stdout and an
> error to stderr :(

Yuck.  The "which -s" thing wouldn't have worked anyway, since the current code is checking the output, not the exit status of the command.  I committed a change in compiler-rt r180792 that should fix this.



More information about the cfe-dev mailing list