Comments on How to give password in shell script?
Post
How to give password in shell script?
+2
−4
That's my Bash script:
#!bin/sh
cd qpixel
sudo systemctl enable mysql
mysql -u root -p
rails s
When it executes the line mysql -u root -p
it will ask for password. To do so, I have tried with echo
and print
, but none of them works.
How can I input a password?
Related question I found in SO. Answers of SO didn't help me either.
2 comment threads