value=""
# do this
grep -q 'search text' inputfile && value="search text"
# or you can do this pick one or the other
awk -v txt="search text" '{ if index($0, txt) > 0 ) { print txt; exit}' | read value
# then find out if it was in the file
if [ -z "$value" ] ; then
echo "not found"
fi
echo "$value"
and the output is:
1 change: lib32
2 metadata the same, data changed: lib32/jniwrap.lic
3 new: lib32/ruben file
4 new: lib32/ruben file 2
5 new: lib32/ruben file 2~
Is possible that I save in a array something like
array(0)=lib32/jniwrap.lic
array(1)=lib32/ruben file
array(2)=lib32/ruben file 2
array(3)=lib32/ruben file 2~