[ITA] - base-files

David Sastre d.sastre.medina@gmail.com
Thu Dec 9 06:29:00 GMT 2010

On Wed, Dec 08, 2010 at 11:21:38PM +0000, Andy Koppe wrote:
> On 8 December 2010 21:22, David Sastre wrote:
> > Hello,
> >
> > I have a base-files-4.0-1 package ready to receive testing. You can fetch it
> I'm afraid there's a syntax error in /etc/profile though:
> elif [ ! -O "$HOME" -a "${HOME#/home/}" != "${HOME}" ]
> That's missing a "; then".

Oops, it looks like I only corrected that in my win7 box and that never made it to my git repo.
(git newbie here, you've been warned! O:-) )

dawud@win7 ~
$ grep elif /etc/profile
elif [ ! -O "$HOME" -a "${HOME#/home/}" != "${HOME}" ]; then

(...and now, I'll have to check for other differences :-D)

> Also, indentation is rather wonky, due to a mix of tabs and spaces.
> You appear to be using a tab size of 2?

Yep. Sorry for that. It was invisible to me... I'll correct this ASAP.
> > I have decided to pull out of /etc/profile the case switch that tries
> > to detect the shell and sets PS1 (and HOSTNAME) accordingly.
> > The reason for this change is that all of bash, mksh, zsh and tcsh, provide
> > their own files for doing that job. The result is a lighter /etc/profile
> > that sets a minimun PS1='$ ' that will be used by posh and dash (the only
> > two shells in the repo that lack specific startup files), allowing shells
> > that do have that files to alter this setting(s).
> > Notice that neither posh nor mksh, despite being ksh derivatives, read
> > /etc/ksh.kshrc nor ~/.kshrc.
> >
> > (I=interactive,L=login,N=non-interactive,B=bash,M=mksh,Z=zsh,T=tcsh,O=posh,dash,!=not)
> > BL=> /etc/profile -> ~/.bash_profile -> ~/.bashrc -> /etc/bash.bashrc
> That's not going to work for people whose .bash_profile and .bashrc
> don't adhere to that pattern or who don't have those files for
> whatever reason, i.e. they'll suddenly get the default "$ " prompt.
> > BI!L=> /etc/bash.bashrc -> ~/.bashrc
> Doesn't /etc/bash.bashrc end up being sourced twice here, due to
> ~/.bashrc including it.

As far as I tested, it doesn't. It happens like I described above.
I'll repeat the tests, though.
FYI, the way I did it was placing a line like this:
in every startup file, and echeoing the var after opening the shell,
both interactive-login and interactive non-login.
And in the case some peolple don't use this layout, well, AFAICT, if
they don't use the default, they are supposed to know what they're
doing, right? And this is the default currently (3.9-3).

> I think your startup file list should distinguish between files that
> are automatically sourced by the shell and those that are sourced by
> other startup files.

All of those files are automatically sourced, depending on the shell
being a login shel or an interactive shell. That's exactly what I'm
trying to get advantage of. To be fair, in the case of a login shell,
we force the course of things, but also does ~/.bash_profile in 3.9-3.
> Regarding the ChangeLog:
>     * New file: skel/.bash_logout: clear the screen after logout.
> Why is that necessary? Do other systems do that?

It's not necessary. Just a nice(?) touch. IIRC, RHEL does.

> Andy

Thanks you for your time.

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-apps/attachments/20101209/99655a7e/attachment.sig>

More information about the Cygwin-apps mailing list