This is my current
read operation that works okay but I'd like to shorten:
echo "Please save your DB root password:" && read -s dbrp echo "Please save your DB user password:" && read -s dbup
This is how I've tried to shorten it and quite failed (the prompt is important for me):
echo "Please save your DB passwords (root, then non-root):" && read -s dbrp && echo "\n" && read -s dbup
It is already in one line as I desired but I'm not comfortable with it because:
- There are two
read -scommands instead just one.
- I must use
echo /nto break row while I would want break without that.
Anything could be done to improve that?
I had a mistake using
echo there (besides for adding
read has its own prompt adding option:
read -sp "What's your DB root password?" dbrp read -sp "What's your DB user password?" dbup