Mag. Leonhard Landrock wrote: > Hi! > > I've got some questions to the use of conditional expressions. I took a look > at the bash manual page, but nevertheless would like some more explanation. > > First, there is the "/etc/profile.d/readline.sh" file: > > When is the following expression true? > > if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ] ; then > INPUTRC=/etc/inputrc > fi >
I think you are getting confused by the -a here. It *is* a bit ambiguous. The [ expr ] construct is a synonym for 'test'. Look at the 'test' builtin in the bash man page (quite a way down): expr1 -a expr2 True if both expr1 and expr2 are true. The -a here is an expression operator between two operands, not a literal conditional expression like -z or ! -f in this example. Note: We could have made it really confusing by the valid statement: if [ -z "$INPUTRC" -a ! -a "$HOME/.inputrc" ] ; then ... :) -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page