I want to print uvuveve
at finish each line, for each output into while statement, as below:
var1;var2;uvuveve
var1;var2;uvuveve
var1;var2;uvuveve
var1;var2;uvuveve
var1;var2;uvuveve
This is my code:
var1="somedata..."
var2="anotherdata..."
while read -u3 w1; read -u4 w2; do
echo "$w1;$w2" >> $file
done 3<<< "$var1" 4<<<"$var2"
var1, var2 print multiple occurrences of a file, so there are many outputs by these variables. I tried to add uvuveve
word like this way:
var1="somedata..."
var2="anotherdata..."
string="uvuveve"
while read -u3 w1; read -u4 w2; read -u5 w3; do
echo "$w1;$w2;$w3" >> $file
done 3<<< "$var1" 4<<<"$var2" 5<<<"$string"
Essentially, I need a print of the word in each line, for each occurrence founded.
Adding Details:
Var1
& var2
retrieve lines of occurrences that a file contains, and then put into variables
Literally the lines are:
var1=$(grep -A12 -B12 "$tofind" $findlogs | grep Date | cut -c 51-65 | sed -e 's! !/!g')
var2=$(grep -A12 -B12 "$tofind" $findlogs | grep Date | cut -c 67-71 | sed -e 's/://g')
echo "$w1;$w2;$w3"
withecho "$w1;$w2;$string"
solve the problem? If not, please provide enough input data (and corresponding desired output) so that we can understand what you are actually trying to do. See How to create a Minimal, Complete, and Verifiable example.var1
andvar2
come from a file? Could you give a real example of input and output?