Linux bash shell script prompt user input and store in variable
This question already has an answer here:
Looks like you may have carriage return / windows line terminations, try to run
dos2unix input.txt
or
sed 's/^M$//' input.txt > output.txt
or
tr -d 'r' < input.txt > output.txt
链接地址: http://www.djcxy.com/p/25552.html