help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Best way to suppress the error message in $(< nonexisten


From: Peng Yu
Subject: Re: [Help-bash] Best way to suppress the error message in $(< nonexistent_file)
Date: Wed, 28 Nov 2018 07:59:10 -0600

> { x=$( <doesnotexist) ;} 2>&-

OK. Thanks. BTW, I think that 2>&- the same as 2>/dev/null
semantically the same. Is it so? Regarding the underlying operations,
are they exactly the same or they are slightly different? My
understanding is the former sets stderr to a null handle, but the
latter set stderr to an existing file handle, but the file handle is
/dev/null. So I'd think the former is a little faster. Is it? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]