Bash script taking input from the user to create an interactive shell script.



  • Take into account the main readme for this section. README first.

    Code.

    $ cat learnbash.sh 
    #!/bin/bash
    
    Message="Hello There!"
    read -p "What is your name? " Name
    echo "$Message $Name"
    

    Run the script.

    $ ./learnbash.sh 
    What is your name? Jill
    Hello There! Jill
    


© Lightnetics 2024