correction:
if [ "$PS1" ] ; then
-----------------------
it is part of a /etc/profile or $HOME/.profile
it is checking if variable PS1 is set (has a non-empty value)
PS1 is the IBM AIX term for "prompt statement, level 1" which looks like this:
$ echo "hi"
hi
"$" == PS1. if you entered PS2 "subshell", PS2 is usually ">"
"$" is only printed if the "shell session" is interactive
it tells you "where you are"
---------------------------------
the script above "sources" (runs) a different script if it detects BASH, else sets PS1 according to which user is opening a terminal/bash session
very typical hacks added to /etc/profile
be VERY CAREFUL hacking /etc/profile: any noise emitted by echo(1) or due to error will cause logins to FAIL. and will cause programs like rsync rsh or something which expect no output and use output as commands (they expect they are not in interactive mode): to fail miserably.
dont hack /etc/profile, use the minimalistic default, unless your sure of what your dealing with
Last edited by X-LFS-2010; 05-02-2016 at 12:58 PM.
|