0

I am using Bash build-in read -p to print message and read user input into REPLY, want a new line at end.

read -p "please input someint\n" did not work, it printed \n rather than a new line.

How do I do that ?

thanks

Ask and Learn
  • 8,661
  • 8
  • 37
  • 43

1 Answers1

1

Try this out.

#!/bin/bash

read -p "Please input something
" msg
echo $msg

This will make read -p print a new line. Hope this helps.

Dale
  • 1,903
  • 1
  • 16
  • 24