0

I am trying to get the PS1 command working with bash.

What I am trying to do is capture the user's data and input it to change the field on the command line.

I know the command is PS1="MadMike", but what I am trying to do is the captured data from the read line and insert it into the command and then run the command

#PS1 Method
1)
echo -e "\n"
#Sub Menu for Method
echo "============================================"
echo "What would you like your command line to say"
echo "============================================"
echo -e "\n"
#Waiting for user input
echo "Type below"

#Capturing User input
read input
#Setting PS1 input
PS1="input:"
4

1 回答 1

0

您错过了$获取input变量内容的标志。它应该是:

PS1="$input:"
于 2016-02-04T16:45:01.690 回答