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.txtactually containRkxBRwo=? you've only shown that it containsRkxBR3tUaGl6STVUaDNGbDRnfQo=$) at the beginning of your output lines (e.g.,$ RkxBRwo=). That doesn’t make sense, and is confusing.