I have exported my putty sessions on my windows box to a .reg file. For each server entry, I need to pull session name and host name. I am able to get this info but have been unable to combine the results on one line.

The closest I have gotten is:

Code:

egrep '(session|hostname)' sourcefile

The results of session and hostname are on separate lines in STDOUT.

I need to:

a. join each match of session and hostname onto one lineb. either before or after the join, I need to run cut or awk to print only the fields I needc. once I have done a & b, I want it to echo each match one at a time. perhaps print one line of session/hostname then wait for the "any key" to be pressed before presenting the next result.

The reason for not posting my source is because it wasn't producing results near to what I was looking for. It would print all of the sessions first then all of the hostnames. The grep command I posted was the closest as it would print the session and corresponding hostname, just not on the same line.

Who is online

Users browsing this forum: No registered users and 3 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum