<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: remote run program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465157#M360376</link>
    <description>cat /etc/passwd|awk -F : '{print $1}' should work however you may try &lt;BR /&gt;cat /etc/passwd|cut -f 1&lt;BR /&gt;&lt;BR /&gt;cut -f &lt;BR /&gt;where list is a list of fields assumed to be separated in the file by a delimiter character (see -d); for example, -f 1,7 copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table subheadings), unless -s is specified&lt;BR /&gt;</description>
    <pubDate>Thu, 23 Jul 2009 03:02:53 GMT</pubDate>
    <dc:creator>Roopesh Francis_1</dc:creator>
    <dc:date>2009-07-23T03:02:53Z</dc:date>
    <item>
      <title>remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465156#M360375</link>
      <description>I have the below script, it is ok to run on local server &lt;BR /&gt;&lt;BR /&gt;#cat /etc/passwd | awk -F: '{ print $1}'&lt;BR /&gt;&lt;BR /&gt;root&lt;BR /&gt;bin&lt;BR /&gt;daemon&lt;BR /&gt;adm&lt;BR /&gt;lp&lt;BR /&gt;sync&lt;BR /&gt;shutdown&lt;BR /&gt;halt&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But if I try to run it at remote server , i tried ssh root@remoteserver "cat /etc/passwd | awk -F: '{ print $1}'" , then the output is as below , the output format is different , can advise what is wrong , how can i use the existing script to run on remote server ? I have many program also want to run at remote server , can advise how can I make it work ? thx a lot&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;root:x:0:0:root:/root:/bin/bash&lt;BR /&gt;bin:x:1:1:bin:/bin:/sbin/nologin&lt;BR /&gt;daemon:x:2:2:daemon:/sbin:/sbin/nologin&lt;BR /&gt;adm:x:3:4:adm:/var/adm:/sbin/nologin&lt;BR /&gt;lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin&lt;BR /&gt;sync:x:5:0:sync:/sbin:/bin/sync&lt;BR /&gt;shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown&lt;BR /&gt;halt:x:7:0:halt:/sbin:/sbin/halt</description>
      <pubDate>Thu, 23 Jul 2009 02:56:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465156#M360375</guid>
      <dc:creator>Son dam bi</dc:creator>
      <dc:date>2009-07-23T02:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465157#M360376</link>
      <description>cat /etc/passwd|awk -F : '{print $1}' should work however you may try &lt;BR /&gt;cat /etc/passwd|cut -f 1&lt;BR /&gt;&lt;BR /&gt;cut -f &lt;BR /&gt;where list is a list of fields assumed to be separated in the file by a delimiter character (see -d); for example, -f 1,7 copies the first and seventh field only. Lines with no field delimiters will be passed through intact (useful for table subheadings), unless -s is specified&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jul 2009 03:02:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465157#M360376</guid>
      <dc:creator>Roopesh Francis_1</dc:creator>
      <dc:date>2009-07-23T03:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465158#M360377</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;This will work&lt;BR /&gt;&lt;BR /&gt;ssh root@remoteserver cat /etc/passwd | cut -f 1 -d":"&lt;BR /&gt;&lt;BR /&gt;it will do the same thing as your script&lt;BR /&gt;&lt;BR /&gt;thanks &lt;BR /&gt;&lt;BR /&gt;Saravanan</description>
      <pubDate>Thu, 23 Jul 2009 03:13:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465158#M360377</guid>
      <dc:creator>saravanan08</dc:creator>
      <dc:date>2009-07-23T03:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465159#M360378</link>
      <description>hi &lt;BR /&gt;&lt;BR /&gt;remove the double quote it will work&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;ssh root@remoteserver cat /etc/passwd | awk -F: '{ print $1}'&lt;BR /&gt;&lt;BR /&gt;it will work</description>
      <pubDate>Thu, 23 Jul 2009 03:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465159#M360378</guid>
      <dc:creator>saravanan08</dc:creator>
      <dc:date>2009-07-23T03:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465160#M360379</link>
      <description>thx replies ,&lt;BR /&gt;&lt;BR /&gt;it works , but may I ask what is the reason of it ? as I have other program has the same problem , I would like to fix by myself . thx</description>
      <pubDate>Thu, 23 Jul 2009 07:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465160#M360379</guid>
      <dc:creator>Son dam bi</dc:creator>
      <dc:date>2009-07-23T07:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465161#M360380</link>
      <description>ssh ... "cat /etc/passwd | awk -F: '{ print \$1}'" &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;because else $1 is interpreted because you are between double quotes.&lt;BR /&gt;so without \ it is the same as&lt;BR /&gt;cat /etc/passwd | awk -F: '{ print }'&lt;BR /&gt;&lt;BR /&gt;so \$1 is necessary.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jul 2009 08:10:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465161#M360380</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-07-23T08:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465162#M360381</link>
      <description>&amp;gt;Laurent: ssh ... "cat /etc/passwd | awk -F: '{ print \$1}'"&lt;BR /&gt;&lt;BR /&gt;That's the solution I found too.&lt;BR /&gt;I first tried to put the command in '' but the shell doesn't seem to want to nest '', even with \'.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;because else $1 is interpreted because you are between double quotes.&lt;BR /&gt;&lt;BR /&gt;Yes, it is that simple.&lt;BR /&gt;You can also use fire to fight fire:&lt;BR /&gt;XX='$1'&lt;BR /&gt;ssh host -n "awk -F: '{ print $XX }' /etc/passwd"</description>
      <pubDate>Thu, 23 Jul 2009 09:22:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465162#M360381</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-07-23T09:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: remote run program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465163#M360382</link>
      <description>on my system it works.&lt;BR /&gt;&lt;BR /&gt;depending of the shell and unix used by your local and remote user&lt;BR /&gt;you may need to have 3 \ in place of 1&lt;BR /&gt;like my old aunt said, when it doesn't work with 1 add 2 others.&lt;BR /&gt;but in my case 1 \ is enough.&lt;BR /&gt;ssh root@myremote "  awk -F: '{print \$1 }'root&lt;BR /&gt;daemon&lt;BR /&gt;bin&lt;BR /&gt;sys&lt;BR /&gt;adm&lt;BR /&gt;uucp&lt;BR /&gt;lp&lt;BR /&gt;nuucp&lt;BR /&gt;hpdb&lt;BR /&gt;nobody&lt;BR /&gt;www&lt;BR /&gt;laurent</description>
      <pubDate>Thu, 23 Jul 2009 09:32:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remote-run-program/m-p/4465163#M360382</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-07-23T09:32:20Z</dc:date>
    </item>
  </channel>
</rss>

