Cecil Westerhof <
Ce...@decebal.nl> wrote:
> Rich <ri...@example.invalid> writes:
>
>> Cecil Westerhof <
Ce...@decebal.nl> wrote:
>>> I like to do the following:
>>> exec ping -q -c 1 -W 1 ${pingDomain} &>/dev/null
>>>
>>> But that gives:
>>> ping: &>/dev/null: Temporary failure in name resolution
>>> while evaluating {exec ping -q -c 1 -W 1 ${pingDomain} &>/dev/null}
>>>
>>> I can do:
>>> $ exec ping -q -c 1 -W 1 ${pingDomain} >/dev/null 2>/dev/null
>>>
>>> But was wondering if there is a better way.
>>
>> Yes, but it involves being /very careful/ when reading the man page.
>>
>> The redirect both "sigil" is >&
>>
>> You used &> above
>>
>> Those two are not the same. :)
>
> Oops, I have seen it done like this so often in Bash, that I not even
> wondered if it could be wrong. For one reason or another this works in
> Bash.
Really? I'm going to have to try that later. Bash is only documented
for >& as well. It will be interesting to see.