Relative Content

Tag Archive for bashgrep

How to read and grep a message echoed to standard output in bash?

I have a bash script that downloads information from a sever using rsync. This script runs on remote client machines. Occasionally, I will get error messages because the server IP may have changed or we have a new server. So for example, I will get a message like this:

using grep with a variable containing xml-tags

i have a script that is trying to find a line in a text file. It could be completely alphanumerical, but it’s also possible that it contains special characters, mostly < and > as it’s sometimes xml-tags with content.