[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Conditional operator in Shell Arithmetic section

**From**: |
uzibalqa |

**Subject**: |
Conditional operator in Shell Arithmetic section |

**Date**: |
Sat, 18 Mar 2023 17:59:59 +0000 |

Have been reading the manual about the arithmetic conditional operation
described by
expr ? expr : exp
This is quite difficult to understand exactly how to use it.
For instance, consider setting the variable opst to 0 when the length of delim
in positive in a bash script. One would use
opst=$(( ${#delim} > 0 ? 0 : 1 ))
There needs to be at least one example of actual use in a typical situation. I
also suggest to include it in section "3.2.5.2 Conditional Constructs".
Specifying conditional operator "expr ? expr : exp" simply as Shell Arithmetic
makes it very difficult to find in the manual.

**Conditional operator in Shell Arithmetic section**,
*uzibalqa* **<=**
**Re: Conditional operator in Shell Arithmetic section**, *Greg Wooledge*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *Lawrence Velázquez*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *uzibalqa*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *alex xmb ratchev*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *Lawrence Velázquez*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *uzibalqa*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *Lawrence Velázquez*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *uzibalqa*, `2023/03/18`
**Re: Conditional operator in Shell Arithmetic section**, *uzibalqa*, `2023/03/19`
**Re: Conditional operator in Shell Arithmetic section**, *Kerin Millar*, `2023/03/19`