• Arun Kumar

Shell Script to Check Vowels

Linux script allows the user to use the case command that accepts the input from the user and match the answer. To elaborate this we are asking the question Enter any vowel and the script will accept the answer in both upper case and lower case.


vi vowel_check.sh
# !bin/bash

echo Enter any vowel?
read response
case $response in
A) echo $response is correct ;;
a) echo $response is correct ;;
E) echo $response is correct ;;
e) echo $response is correct ;;
I) echo $response is correct ;;
i) echo $response is correct ;;
O) echo $response is correct ;;
o) echo $response is correct ;;
U) echo $response is correct ;;
u) echo $response is correct ;;
*) echo sorry, that is wrong
esac

Here is the sample output of the above script


More ways to use case

  • You can use the case command to accept the user input and match the case

  • You can ask for user input and evaluate it using case command and returns the response

5 views

Recent Posts

See All

Basic Linux Commands

This article describes basic Linux commands that you must know as a system or database administrator. Below commands in Linux help you manage any Linux server fast and smoothly. Linux Command List Che

Linux Firewall with iptables and firewalld

In this article will be covering details regarding iptables and firewalld which helps in Linux firewall management. We will also be looking at how to enable specific ports (1521 for Oracle) inside ipt

Passwordless SSH in Linux

Every time you ssh from one Linux server to another, you need to enter target server user's password. We can also setup passwordless ssh in Linux between two Linux servers so that you don't have to en

  • Facebook
  • Twitter
  • YouTube
  • Instagram

© 2020 by DBA Genesis