I am trying to run the following command
echo `grep -o "<\/div><div class\=\".*" $1` |
grep -o "title=\\"\(.*\?\)\\" aria-describedby" -> title.txt
from script test.sh
.
However, every time I check my file title.txt
, it is empty.
I tested the first part of the command,
echo `grep -o "<\/div><div class\=\".*" $1`
and it works fine.
The second part is the one with the problem"
grep -o "title=\\\"\(.*\?\)\\\" aria-describedby" -> title.txt
Just to keep in mind, this is not being run from the terminal itself, but from a bash script file being called from the terminal.
I believe my problem lies in how I am quoting or escaping the quotes.