Results 1 to 4 of 4
I'm new to bash scripting. I just cannot seem to find the answer anywhere. I've read some tutorials to get the taste of bash scripting but I haven't read enough ...
- 05-31-2008 #1
Bash Script User Input...
I'm new to bash scripting. I just cannot seem to find the answer anywhere. I've read some tutorials to get the taste of bash scripting but I haven't read enough yet.
Right now I am trying to get some user input and add it to a variable. I want it to prompt the user on the same line that the prompt for input is on. For example:
Enter the name: userInput
but when I run the script it looks like this:
[b]Enter the name:
userInput
Does anyoen know how I can fix my code to make it work how I want? Thanks.
Code:echo "Enter the name that each file will be renamed to (ex. picture): "; read NAME; echo echo "Enter the number you'd like to start at: "; read NUM;
- 05-31-2008 #2
Hi flipjargendy !
Add -n after echo to disable new line.
Code:echo -n "Enter the name that each file will be renamed to (ex. picture): "; read NAME; echo echo -n "Enter the number you'd like to start at: "; read NUM;
It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 05-31-2008 #3
hi,
you can also do it as follows(with one command)
and there you goCode:read -p "Enter the name that each file will be renamed to (ex. picture): " NAME
Linux and me it's a love story
- 06-01-2008 #4
Thanks guys.


Reply With Quote