1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bash User Input

Discussion in 'Shell Script' started by Gabriel9999, May 2, 2019.

Tags:
  1. Gabriel9999

    Gabriel9999 New Member

    Joined:
    Mar 12, 2019
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I am writing a script which requires user inpu. How can i prompt for use in my bash script.
     
  2. samueltarcin9999

    samueltarcin9999 New Member

    Joined:
    Mar 12, 2019
    Messages:
    9
    Likes Received:
    8
    Trophy Points:
    3
    You can use read command in bash where input will be set into a bash variable. Read -p "What is your age" age In ihis example the user input value will be set into age.
    Reference : poftut.com/prompt-input-bash/
     
    Gabriel9999 likes this.

Share This Page