Getting started with conditionals

Sort by

recency

|

340 Discussions

|

  • + 0 comments

    read input

    if [[ $input =~ [Yy] ]]; then echo "YES" else echo "NO" fi

  • + 0 comments

    Practice using real-life examples to grasp how conditionals influence behavior in different scenarios. Gold 365.site

  • + 0 comments

    read -p "Ingresa Y/N: " c

    if [[ ]]; then echo "NO"s else echo "YES" fi

  • + 0 comments
    read c
    if [ $c = 'Y' -o $c = 'y' ]
    then
        echo "YES"
    else
        echo "NO"
    fi
    
  • + 0 comments
    #!/bin/bash
    read -rN1 INPUT
    [[ ${INPUT,,} = "y" ]] && echo "YES" || echo "NO"