![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Double quotes or single quotes when using ssh? | password636 | Shell Programming and Scripting | 3 | 05-29-2008 09:52 PM |
| why is this code generating syntax error?pls help | wrapster | Shell Programming and Scripting | 3 | 05-21-2008 03:01 PM |
| ksh execute command containing double quotes | pearson05 | Shell Programming and Scripting | 1 | 05-02-2008 06:25 AM |
| unix command to insert double quotes | berlin_germany | Shell Programming and Scripting | 2 | 01-17-2007 01:07 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
too many quotes in command, generating error
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...
What am I missing? ssh hostname `getent passwd | grep username | awk -F":" '{print ($3)}'` ksh: syntax error at line 1 : `(' unexpected |
|
||||
|
[host]
[/] [root-128]:getent passwd | grep user | awk -F":" '{print ($3)}' 4022 [host] [/] [root-129]:getent passwd | grep user | awk -F":" '{print $3}' 4022 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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|