I am trying to go through a file with hostnames and access those hosts remotely an excute the following to get the uid of user on each of the boxes.. but i have so many quotes.. its not working.. I fudged with the \ before certain quotes, but that was unsuccessful too...
Well, good to know that both work.. i have always done it the first way.. However, I am still having an issue executing the command remotely because I need to put it in quotes to run the ssh remote command. or is there another way of doing it?
ssh host 'getent passwd | grep user | awk -F":" '{print $3}''
awk: syntax error near line 1
awk: illegal statement near line 1