I'm trying to find and print out all the files that contain a base64 encoded string, using grep
and command substitution.
If I first encode the base64 string, and then grep, I'm able to find the file:
$ echo "FLAG" | base64
RkxBRwo=
$ grep -nr "Rkx"
test.txt:1:RkxBR3tUaGl6STVUaDNGbDRnfQo=
But when I use command substitution I get no ouput.
$ grep -nr `echo "FLAG" | base64`
test.txt
actually containRkxBRwo=
? you've only shown that it containsRkxBR3tUaGl6STVUaDNGbDRnfQo=
– steeldriver May 05 '19 at 17:23$
) at the beginning of your output lines (e.g.,$ RkxBRwo=
). That doesn’t make sense, and is confusing. – Scott - Слава Україні May 05 '19 at 18:17