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:"
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
MadMike
  • 9
  • 1

1 Answers1

0

You've missed the $ sign to get the content of the input variable. It should be:

PS1="$input:"
Mehdi Yedes
  • 2,267
  • 2
  • 14
  • 14