[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 |
Hi,
The bash man page lists the ternary operator:
expr?expr:expr
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
--
Ian Macdonald | "Our vision is to speed up time, eventually
ian@caliban.org | eliminating it." -- Alex Schure
|
|
|
- ternary operator,
Ian Macdonald <=