• Arun Kumar

Shell Script to Ask User Favourite Games

In Linux bash shell script we can create a script to ask the user to input multiple entries and we can display a customized response after the user input. This will be achieved with a reading command to accept the entries and an echo command to display the entries with customizing options.

vi  favourite_game.sh
# !/bin/bash

# Favourite  Games

#Taking multiple inputs
echo "Type your Favourite Games"
read game1
read game2 
read game3 
read game4 
read game5 
read game6

echo "$game1 is your first choice"
echo "$game2 is your second choice"
echo "$game3 is your third choice"
echo "$game4 is your fourth choice"
echo "$game5 is your fifth choice"
echo "$game6 is your sixth choice"

Here is the sample output of the above script

More ways to the user multiple entries

  • You may use it where the user has more than one answers

  • You can ask the user to enter more than one input and evaluate their inputs with if-else and respond accordingly.


Recent Posts

See All

Oracle 19c Installation on Linux

Oracle 19c adds more features to Oracle database and this article demonstrates Oracle 19c installation on Linux 7. We will be using Oracle Linux 7 and Oracle Database 19.3 softwares for this activity.

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