need to read values in middle of reading value from a file
#!bin/bash
while read line do echo $line read $variable done <<filename $variable is getting the same value which is being read from the file. is there a way i can scan values from keyboard while reading a file line by line?? |
what are you trying to do actually? in your while loop, you are reading lines and putting them into variable $line. Where does $variable come from??
|
File & stdin read, using exec
Code:
#!/usr/bin/bash |
Quote:
Quote:
Code:
while read -r line |
read values in middle
Hi thanks for ur response
variable is just a input needed from the key board not from the file,but its not allowing me to take input from keyboard,what i mean is variable is getting the same value in $line.what i exactly wanted is,i want to take input from keyboard while iam reading a file line by line. After almost searching for an hour i found out the solution,which is working perfect,now variable is able to get input from keyboard But can anyone please tell me whats the functionality of < /dev/tty??i just dont want to do things blindly while read line echo $line read variable < /dev/tty done < file name |
All times are GMT -5. The time now is 07:01 AM. |