Search code examples
linuxshellrhel

How to select an option automatically from a prompt message in shell script?


when i run my script manually it prompts a message to select YES or NO . I am automating this part in shell scripting, how to automatically select YES

script.sh - if i run this it should take the option YES by default


Solution

  • It was very simple, i just simply gave an echo

    script.sh - main script

    #!/bin/bash
    some_process
    echo YES | process