I used grep to fetch result from two files and store the result in two variable respectively. while I echo the output of two variable at that time if I change the position of variable then the result is changing . The scenario is explained below with the example
the issue is happening only on my terminal I tested it in other machine it is working fine , even In my terminal it was working till yesterday , don't know what change has happened which impacted this
NameFile contains the information like Student_id Name_of_student Mobile_No Location Email_id
FeeInformation file contains values Student_id Class Fee Admission_type( DOnation/Free)
Please suggest what could be the possible reason for this . Thanks in advance
Code:
i=123
res1=`grep S$i $NamesFile`
res2=`grep S$i $FeeInformation|awk '{$1="" ; print $0}'`
echo "$res1 $res2" ## this prints the value from both variable separated by space
echo "$res2 $res1" ## in this the variable two override the output of variable one
the issue is happening only on my terminal I tested it in other machine it is working fine , even In my terminal it was working till yesterday , don't know what change has happened which impacted this
NameFile contains the information like Student_id Name_of_student Mobile_No Location Email_id
FeeInformation file contains values Student_id Class Fee Admission_type( DOnation/Free)
Please suggest what could be the possible reason for this . Thanks in advance