Gl1
1
hi
name$count = some dynamic value
now i want to use dat dynamic value in grep so how m i supposed to do dat
i tried
\`grep $\(name$count\) source\`
, it is not working ......
what will be after grep so dat i will be able to grep dat dynamic value ......
m stuck
try this for a fixed text pattern
grep -F "name$count" sourcefile
pamu
3
can we minimize this...
i have tried lot but not find any solutions yet..:wall:
grep $(eval echo "$`echo "name$count"`") file
Lem
4
Maybe: grep "$(eval echo '$name'$count)"
However, if the OP's shell has arrays...
--
Bye
I can't tell what you're even trying to do, but in bash or new enough ksh you can do
ASDF="1234"
VARNAME="asdf"
echo "${VARNAME}=${!VARNAME}"