We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Getting started with conditionals
Getting started with conditionals
Sort by
recency
|
331 Discussions
|
Please Login in order to post a comment
I used case statement ->
read input case $input in [yY]) echo "YES" ;; [nN]) echo "NO" ;; esac
Easy solution:
EXPLANATION : : we are reading the char, :next if the char == length 1 we pass that to check if it is y,Y,n,N if it is anyone of it we print and exit
This worked for me.
`