If Linux command has single prompt then we can handle it like following -

echo "password" | sudo -S ls

But startWebLogic.sh has two prompts, one for username and other for password to boot WebLogic server.

I tried with following

sh startWebLogic.sh << EOF
> user
> password

but it end up with following which indicates command did not succeed

<Aug 31, 2020 7:04:59 PM GMT> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to FORCE_SHUTTING_DOWN.>
Stopping Derby server...
Derby server stopped.

Can you please suggest how I can pass two arguments of prompt in single command?


What I would try:

    echo username
    sleep 1
    echo passwd
} | bash startWebLogic.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.