My script starts out by connecting to another machine via SSH and
reading the hosts file into a variable:
z = ssh -l username -i /home/username/.ssh/id_rsa 10.1.1.1 cat /etc/hosts
Normally if the hosts file was on my local machine, I would be able to
step through the contents of the file line by line and make decisions
based on REGEX using the file open commands.
I don’t want to have to write the contents of my variable to a file and
then open and step through it that way.
What would be the best way to step through my z variable line by line
and match on the content with REGEX?
thanks
jack