Skip to main content
added 7 characters in body
Source Link

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
]; then
   var0=9
else
   var0=21
fi

extends

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]; then
   var0=9
else
   var0=21
fi

extends

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

Improved formatting.
Source Link
thatguy
  • 22.3k
  • 6
  • 33
  • 46

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends condition?result-if-true:result-if-false

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ] then var0=9 else var0=21 fi

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends condition?result-if-true:result-if-false

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ] then var0=9 else var0=21 fi

extends

condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

You can use like bellow:

(( var0 = var1<98?9:21 ))

the same as

if [ "$var1" -lt 98 ]
then
var0=9
else
var0=21
fi

extends condition?result-if-true:result-if-false

I found the interested thing on the book "Advanced Bash-Scripting Guide"

Source Link
Loading