Reputation: 14264
How do I embed spaces in my prompt variable for the read
command in my bash script?
rebase_prompt="Proceed with rebase? [y/n] "
read -p $rebase_prompt user_response
When this code runs it appears on the terminal as only "Proceed" waiting for my input.
Proceed
How do I get it to take the full string as the prompt?
Upvotes: 0
Views: 51
Reputation: 799370
By quoting correctly.
read -p "$rebase_prompt" user_response
Upvotes: 4