• 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.

1 view

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