****************************************************
grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` >Files.txt
#The indentified files were written to Files.txt
for i in `cat Files.txt`
do
#Copies indentified files as Lin_filename
cp -p $i $Lin\_$i
#Moves Lin_filename files to MQ retry directory
mv $Lin\_$i /merccesar/data/router/inMqR/retry/
done
******************************************************
If you see here I am writting the result of grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` into a file.
and then copying and moving the files in the Files.txt.
Instead of loop I want to store the value of *** grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'` *** into a variable and then copy and move ...
But
when I tried the below command
Var=`grep -l $Timestamp `ll|grep "$1 $2 $3"|awk '{print $NF}'``
It is not getting executed
Please help me !!!
Thank You
Subbu