latitude=45
#[[ и ]] - слова: вокруг них нужны пробелы
#if [[$latitude == 0]]; then #<- Error: "[[45: command not found"
#без пробелов вокруг == условие - одна строка "45==0", а непустая строка истинна
[[ $latitude==0 ]] && noSpaces=true || noSpaces=false
#noSpaces is true
[[ $latitude == 0 ]] && withSpaces=true || withSpaces=false
#withSpaces is false
#> внутри [[ ]] сравнивает текст: "10" стоит раньше "9"
[[ 10 > 9 ]] && asText=true || asText=false
#asText is false
(( 10 > 9 )) && asNumbers=true || asNumbers=false
#asNumbers is true
#у присваивания вокруг = нет пробелов
#latitude = 0 #<- Error: "latitude: command not found"
echo "noSpaces is $noSpaces"
echo "withSpaces is $withSpaces"
echo "asText is $asText"
echo "asNumbers is $asNumbers"