Hi,
Am trying to store the user inputs into a file, but the below code will store only the first line of the values. I need to store all the user input values which may contain one or more lines. Thanks in advance.
echo "please enter file names";
read name;
echo $name>/tmp/test
My requirement is to get multiple names from user and store in a file name . Here the below code is working for a single name , but need the same for multiple names.
echo "Please enter file names:"
read name
echo $name>/tmp/test
If I try the below code the file names are getting populated into the file but am not able to perform the task using those values. Not sure whether the script identifies whether the file EOF is reached or not. After storing into the file its not working further.
echo "please enter file names"
while read name
do
echo "$name"
done >/tmp/test
My requirement is to get multiple names from user and store in a file name . Here the below code is working for a single name , but need the same for multiple names.
Code:
echo "Please enter file names:"
read name
echo $name>/tmp/test
If I try the below code the file names are getting populated into the file but am not able to perform the task using those values. Not sure whether the script identifies whether the file EOF is reached or not. After storing into the file its not working further.
Code:
echo "please enter file names"
while read name
do echo "$name"
done >/tmp/test