[ANNOUNCEMENT] Updated base-files-4.0-6

David Sastre d.sastre.medina@gmail.com
Fri Apr 1 18:09:00 GMT 2011


On Thu, Mar 31, 2011 at 12:24:33PM +0100, Jon TURNEY wrote:
> On 31/03/2011 01:03, Cyrille Lefevre wrote:
> > Le 31/03/2011 01:53, Cyrille Lefevre a écrit :
> >> Le 18/03/2011 19:45, David Sastre a écrit :
> >>> Version 4.0-6 of base-files has been uploaded.
> >>>
> >>> Base-files is a set of system configuration and setup files.
> > 
> > Hi,
> > 
> > PS1 *must not* be exported.
> > 
> > historically, it is not exported to know if it is a shell is interactive or
> > not since only interactive shells set it.
> > 
> > i.e., the following both solutions are equivalent.
> > 
> > case $- in *i*) interactive ;; esac
> > [ -n $PS1 ] && interactive
> > 
> > if PS1 is exported, it is always set for subshells and this may cause trouble
> > in some script.
> > 
> > also, from man bash :
> > 
> > An  interactive  shell  is one started without non-option arguments and
> > without the -c option whose standard input and error are both connected
> > to  terminals  (as determined by isatty(3)), or one started with the -i
> > option.  PS1 is set and $- includes i if bash is interactive,  allowing
> > a shell script or a startup file to test this state.
> 
> What the man page doesn't tell you is that bash actually unsets PS1 if the
> shell isn't interactive, so for bash at least, exporting PS1 can't cause a
> problem.

Hello,

Both improvements have been checked in for a future 4.0-7 version.
I'm waiting for dash to be updated to include also a simpler PRINTER
setting as you proposed.

-- 
Huella de clave primaria: 0FDA C36F F110 54F4 D42B  D0EB 617D 396C 448B 31EB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://cygwin.com/pipermail/cygwin/attachments/20110401/7dc98b64/attachment.sig>


More information about the Cygwin mailing list