Re: bash shell startup files
Bruce Dubbs wrote: 2) /etc/profile.d/extrapaths.sh uses the [ -d /usr/local/sbin -a $EUID -eq 0 ] construction, but the -a doesn't work in all shells (try posh). Suggestion: [ -d /usr/local/sbin ] [ $EUID -eq 0 ] The title of the section is Bash Shell Startup Files. I prefer to leave this alone, although I wouldn't be opposed to making the comment in the descriptive text that some constructs in the files are Bash specific and may not run in all shells without modification. After all, they won't run at all in tcsh. Correct, tcsh does not attempt to use /etc/profile as its startup file (FIXME: the book currently says nothing about csh startup files). However, /etc/profile is read by all shalls that position themselves as Bourne-compatible, so it must contain no bashisms. 4) It should be mentioned that umask (as set in the book) doesn't work for non-shell logins (e.g., scp or svn-over-ssh). A recommendation to use pam-umask (http://ftp.debian.org/debian/pool/main/p/pam-umask/pam-umask_0.04.tar.gz) may be more suitable. In my opinion, pam is a PITA. It is useful in multi-user environments, but shouldn't be a default for BLFS. The top of the section does already says that non-login shells normally only run ~/.bashrc. Perhaps more examples may be useful, but we can't really cover every circumstance where a non-login shell is run. That's why this module has been created. I do not propose to make this the default, but IMHO not everyone knows about this solution - so why not mention it? -- Alexander E. Patrakov -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: bash shell startup files
Alexander E. Patrakov wrote: Bruce Dubbs wrote: 2) /etc/profile.d/extrapaths.sh uses the [ -d /usr/local/sbin -a $EUID -eq 0 ] construction, but the -a doesn't work in all shells (try posh). Suggestion: [ -d /usr/local/sbin ] [ $EUID -eq 0 ] The title of the section is Bash Shell Startup Files. I prefer to leave this alone, although I wouldn't be opposed to making the comment in the descriptive text that some constructs in the files are Bash specific and may not run in all shells without modification. After all, they won't run at all in tcsh. Correct, tcsh does not attempt to use /etc/profile as its startup file (FIXME: the book currently says nothing about csh startup files). However, /etc/profile is read by all shalls that position themselves as Bourne-compatible, so it must contain no bashisms. I'm afraid I disagree. When you lower something to the least common denominator, there is no progress. One of the objectives of the book is education. Showing different constructs is educational. If the user changes the login shell, solving any problems will also be educational. I have no problem saying that using a shell other than bash will probably require some adjustments to the config files. 4) It should be mentioned that umask (as set in the book) doesn't work for non-shell logins (e.g., scp or svn-over-ssh). A recommendation to use pam-umask (http://ftp.debian.org/debian/pool/main/p/pam-umask/pam-umask_0.04.tar.gz) may be more suitable. In my opinion, pam is a PITA. It is useful in multi-user environments, but shouldn't be a default for BLFS. The top of the section does already says that non-login shells normally only run ~/.bashrc. Perhaps more examples may be useful, but we can't really cover every circumstance where a non-login shell is run. That's why this module has been created. I do not propose to make this the default, but IMHO not everyone knows about this solution - so why not mention it? An easier solution would be to tell the user to put the umask statement in ~/.bashrc. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: bash shell startup files
Alexander E. Patrakov wrote: Hello, the bash shell startup files section can be improved: 1) /etc/profile tests for EUID=0 in two different ways: |if [ $EUID -eq 0 ] ; then pathappend /sbin:/usr/sbin unset HISTFILE fi| |if [[ $EUID == 0 ]] ; then PS1=$RED\u [ $NORMAL\w$RED ]# $NORMAL else PS1=$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL fi | Please remove the == construction, it is completely unneeded here, -eq works just fine. Also, # can be replced with \$, too. Although you are correct about unneeded, I think it should remain as a demonstration of different techniques. 2) /etc/profile.d/extrapaths.sh uses the [ -d /usr/local/sbin -a $EUID -eq 0 ] construction, but the -a doesn't work in all shells (try posh). Suggestion: [ -d /usr/local/sbin ] [ $EUID -eq 0 ] The title of the section is Bash Shell Startup Files. I prefer to leave this alone, although I wouldn't be opposed to making the comment in the descriptive text that some constructs in the files are Bash specific and may not run in all shells without modification. After all, they won't run at all in tcsh. 3) /etc/profile.d/readline.sh is completely unneeded - readline-5.2 looks in /etc/inputrc by default. But it does show how to change things if the default is not used. Again, a comment that it is unnecessary if using the defaults wouldn't hurt, but I think the example should remain. 4) It should be mentioned that umask (as set in the book) doesn't work for non-shell logins (e.g., scp or svn-over-ssh). A recommendation to use pam-umask (http://ftp.debian.org/debian/pool/main/p/pam-umask/pam-umask_0.04.tar.gz) may be more suitable. In my opinion, pam is a PITA. It is useful in multi-user environments, but shouldn't be a default for BLFS. The top of the section does already says that non-login shells normally only run ~/.bashrc. Perhaps more examples may be useful, but we can't really cover every circumstance where a non-login shell is run. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: bash shell startup files
On 9/30/07, Bruce Dubbs [EMAIL PROTECTED] wrote: Alexander E. Patrakov wrote: Hello, the bash shell startup files section can be improved: 1) /etc/profile tests for EUID=0 in two different ways: |if [ $EUID -eq 0 ] ; then pathappend /sbin:/usr/sbin unset HISTFILE fi| |if [[ $EUID == 0 ]] ; then PS1=$RED\u [ $NORMAL\w$RED ]# $NORMAL else PS1=$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL fi | Please remove the == construction, it is completely unneeded here, -eq works just fine. Also, # can be replced with \$, too. Although you are correct about unneeded, I think it should remain as a demonstration of different techniques. For the ==, I agree. For the #, I think it makes more sense to show that \$ expands to '#' for root. 3) /etc/profile.d/readline.sh is completely unneeded - readline-5.2 looks in /etc/inputrc by default. But it does show how to change things if the default is not used. Again, a comment that it is unnecessary if using the defaults wouldn't hurt, but I think the example should remain. I agree with Alexander here. See readline(3), INITIALIZATION FILE section. Readline checks for ~/.inputrc, then falls back to /etc/inputrc unless INPUTRC is set. I see what you mean about showing how the variable can be used, but I think this is beyond the scope of what most people will care about. There are tons of other environment variables that we don't discuss, and I think most users will be entirely happy with the readline default behavior. In LFS, it is also suggested that `info readline' is read, and users would be able to find this information there. What I'd like to see in LFS instead of suggesting that the contents of /etc/inputrc can be copied to the user's ~/.inputrc is a suggestion to use $include /etc/inputrc. But that's not a BLFS discussion. -- Dan -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: Bash shell startup files
El Jueves, 22 de Marzo de 2007 19:30, Randy McMurchy escribió: Hi all, I'm not certain of something. Do we expect *all users* to perform the steps shown in the Bash shell startup files? I know I don't do them. I have my own way of setting up /etc/profile, et. all. To me that section is only an example about how to improve bash configuration, but it is not mandatory and we should not force users to follow it by the letter. That is applicable also to the rest of the After LFS Configuration Issues chapter., IMHO And this makes the JDK instructions related to the CLASSPATH broken. I'm not a big fan of this pathprepend and pathappend stuff. In fact, I'd like to remove it in favor of something that isn't BLFS specific. I agree. I'm wondering if the Bash Shell Startup Files shouldn't be listed in the required dependencies? No, please. I don't recall anything in BLFS as being mandatory, yet the JDK instructions simply *assume* that folks followed the Bash Shell startup stuff. Thus bad assumption, IMHO. I'm looking for an answer, as I think we need to add JUnit to the book as it is now required by Apache Ant. And Apache Ant is now a required dependency for FOP (Ant is no longer in the FOP source tree). The Junit install dir and the .jar file need to be in the CLASSPATH and I'm not sure how to handle this. The standard CLASSPATH=$CLASSPATH:/path/to/jar_file should work and be enough. -- Manuel Canales Esparcia Usuario de LFS nº2886: http://www.linuxfromscratch.org LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.info TLDP-ES: http://es.tldp.org -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page
Re: Bash shell startup files
M.Canales.es wrote these words on 03/22/07 14:19 CST: The standard CLASSPATH=$CLASSPATH:/path/to/jar_file should work and be enough. Thanks for the input, Manuel. I too am in favor of showing *what* needs to be done, not *how* it should be done (when it comes to setting up login shell scripts). And just for the record, JUnit wants its installation directory in the CLASSPATH also (required to run the regression tests on JUnit, anyway). So, it would be this: CLASSPATH=$CLASSPATH:/path/to/junit-4.1.jar:/usr/share/junit-4.1 (assuming JUnit is installed in /usr/share/junit-4.1) -- Randy rmlscsi: [bogomips 1003.28] [GNU ld version 2.16.1] [gcc (GCC) 4.0.3] [GNU C Library stable release version 2.3.6] [Linux 2.6.14.3 i686] 14:29:01 up 13 days, 12:28, 1 user, load average: 0.14, 0.06, 0.02 -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page