[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ternary operator

From: Ian Macdonald
Subject: ternary operator
Date: Sun, 23 Jun 2002 01:54:07 -0700
User-agent: Mutt/1.4i


The bash man page lists the ternary operator:


However, I can't figure out how one is supposed to use it in bash.

I would expect it to be analagous to the same operator in C:

$ [ foo = 1 ] ? echo yes : echo no
bash: [: missing `]'

but this is clearly not what bash is expecting.

What am I missing?

Ian Macdonald               | "Our vision is to speed up time, eventually
address@hidden             | eliminating it." -- Alex Schure 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]