This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Problems with the new base-files-4.0-5?
On 3/17/2011 3:21 PM, Eric Blake wrote:
> On 03/17/2011 12:59 PM, Angelo Graziosi wrote:
>> Perhaps you need this:
>>
>> - ([[ -e ${p} ]] && read -r PRINTER < ${p}) && PRINTER=${PRINTER%%,*}
>> + ([[ -e ${p} ]] && read -r PRINTER < "${p}") && PRINTER=${PRINTER%%,*}
>
> /etc/profile is using [[ ]]? Bad. That's not required by POSIX, and
> will break for anyone who logs in with a shell that doesn't understand
> it (for example, dash or posh). Bashisms should not appear in /etc/profile.
Yep. This is /etc/profile which is used by all POSIX shells, not just
bash. Now, if we were talking about ~/.bash_profile or some mythical
/etc/bash_profile [1], that'd be different.
[1] bash doesn't actually use any file by this name
Try running this
$ dash -li
(oddly, posh -li doesn't report any errors...)
--
Chuck
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple