<?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: remsh loses command auguments in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060901#M737331</link>
    <description>John -&lt;BR /&gt;&lt;BR /&gt;That did the trick!  &lt;BR /&gt;&lt;BR /&gt;I agree with the ssh comment, and we are moving in that direction with new servers, but sometimes you just have to work with what you have at the moment.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
    <pubDate>Mon, 27 Aug 2007 12:44:31 GMT</pubDate>
    <dc:creator>Scott Lindstrom_2</dc:creator>
    <dc:date>2007-08-27T12:44:31Z</dc:date>
    <item>
      <title>remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060891#M737321</link>
      <description>I have a command that I remsh from one server to another.  It happens to be a execution of sudo, but I dont think that it the problem.  It looks like this (with the specific info changed):&lt;BR /&gt;&lt;BR /&gt;remsh rmtserver  /usr/local/bin/sudo  /usr/bin/su - someuser -c "/usr/local/bin/rmt_script arg1 arg2"&lt;BR /&gt;&lt;BR /&gt;When the script runs on the remote server the two arguments are not being received.  (I reference $1 and $2 to save them into variables, and they are blank).&lt;BR /&gt;&lt;BR /&gt;If I run the command directly on 'rmtserver':&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/sudo  /usr/bin/su - someuser -c "/usr/local/bin/rmt_script arg1 arg2"&lt;BR /&gt;&lt;BR /&gt;it runs fine.  So it seems that somehow using remsh drops the arguments.&lt;BR /&gt;&lt;BR /&gt;I have tried all sorts of single quotes, double quotes, etc yet have not been able to find some way of making the two arguments gets passed to the remote server.  Anyone have any ideas?&lt;BR /&gt;&lt;BR /&gt;Scott</description>
      <pubDate>Mon, 27 Aug 2007 09:48:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060891#M737321</guid>
      <dc:creator>Scott Lindstrom_2</dc:creator>
      <dc:date>2007-08-27T09:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060892#M737322</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;/usr/local/bin/rmt_script&lt;BR /&gt;&lt;BR /&gt;echo $# "That was the number of arguments"&lt;BR /&gt;&lt;BR /&gt;Let's see if its getting aruguments or if it is confused.&lt;BR /&gt;&lt;BR /&gt;We are tyring something complex. We sudo to run su to a user to run a commmand.&lt;BR /&gt;&lt;BR /&gt;Other ideas(for grins)&lt;BR /&gt;&lt;BR /&gt;Try the same thing with ssh openssh/secure shell. It might act differently. &lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 27 Aug 2007 09:54:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060892#M737322</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-08-27T09:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060893#M737323</link>
      <description>Steven -&lt;BR /&gt;&lt;BR /&gt;I did put some of that code in:&lt;BR /&gt;&lt;BR /&gt;echo $#&lt;BR /&gt;&lt;BR /&gt;And get this when I run it with remsh&lt;BR /&gt;&lt;BR /&gt;+ echo 0&lt;BR /&gt;&lt;BR /&gt;I do see the whole setup is a bit odd. I have a script running as user1 to sudo a command that then su's to run as user2.  So sudo is just my facilitator to allow this.&lt;BR /&gt;&lt;BR /&gt;Scott</description>
      <pubDate>Mon, 27 Aug 2007 09:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060893#M737323</guid>
      <dc:creator>Scott Lindstrom_2</dc:creator>
      <dc:date>2007-08-27T09:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060894#M737324</link>
      <description>note that the command you pass is sudo, everything else is an argument, so you may need to move the first double quote to just before /usr/local.&lt;BR /&gt;&lt;BR /&gt;also, why are you using sudo to run su? wouldn't sudo -u username work?</description>
      <pubDate>Mon, 27 Aug 2007 10:52:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060894#M737324</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-08-27T10:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060895#M737325</link>
      <description>Also, are args 1 and 2 literals or shell variables, ie. $arg1 $arg2???</description>
      <pubDate>Mon, 27 Aug 2007 10:54:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060895#M737325</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-08-27T10:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060896#M737326</link>
      <description>I tried moving the first double quote to right after 'sudo' and get the same results. &lt;BR /&gt;&lt;BR /&gt;I was not familiar that sudo could be used to switch to anything other than root, so I can try that option and see what happens.&lt;BR /&gt;&lt;BR /&gt;The arguments being passed right now are literals (during my initial testing), but later on will be variables.&lt;BR /&gt;&lt;BR /&gt;Scott</description>
      <pubDate>Mon, 27 Aug 2007 10:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060896#M737326</guid>
      <dc:creator>Scott Lindstrom_2</dc:creator>
      <dc:date>2007-08-27T10:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060897#M737327</link>
      <description>I also tried the quotes just before /usr/local/bin; same results.</description>
      <pubDate>Mon, 27 Aug 2007 11:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060897#M737327</guid>
      <dc:creator>Scott Lindstrom_2</dc:creator>
      <dc:date>2007-08-27T11:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060898#M737328</link>
      <description>Shalom again Scott,&lt;BR /&gt;&lt;BR /&gt;Simply and rectify.&lt;BR /&gt;&lt;BR /&gt;Change the script so it does nothing but echo arguments on the other end, or work with a cotpy.&lt;BR /&gt;&lt;BR /&gt;Then as root, try and get things working.&lt;BR /&gt;&lt;BR /&gt;Once that is resolved, than add sudo to the mix and play with the quotes some more. &lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 27 Aug 2007 11:02:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060898#M737328</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-08-27T11:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060899#M737329</link>
      <description>sep beat me to it,&lt;BR /&gt;&lt;BR /&gt;simple script, then&lt;BR /&gt;1) remsh the script w/literals&lt;BR /&gt;2) remsh script w/ variables (double qouting should, ie remsh srvx "script $a $b")&lt;BR /&gt;&lt;BR /&gt;then start w/ sudos and su</description>
      <pubDate>Mon, 27 Aug 2007 11:06:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060899#M737329</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2007-08-27T11:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060900#M737330</link>
      <description>First off, IMHO, you should not be using remsh, and need to convert to ssh.&lt;BR /&gt;&lt;BR /&gt;That being said, I think that this stands a chance of working , but I can't test it because I don't have remsh working anywhere.&lt;BR /&gt;&lt;BR /&gt;remsh rmtserver "/usr/local/bin/sudo /usr/bin/su - someuser -c \"/usr/local/bin/rmt_script arg1 arg2\""&lt;BR /&gt;&lt;BR /&gt;Just quote the remote shell command, and sub-quot the sudo command with backslashes, so that they are not evaluated unto the sudo command gets the strings.</description>
      <pubDate>Mon, 27 Aug 2007 11:52:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060900#M737330</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2007-08-27T11:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: remsh loses command auguments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060901#M737331</link>
      <description>John -&lt;BR /&gt;&lt;BR /&gt;That did the trick!  &lt;BR /&gt;&lt;BR /&gt;I agree with the ssh comment, and we are moving in that direction with new servers, but sometimes you just have to work with what you have at the moment.&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;</description>
      <pubDate>Mon, 27 Aug 2007 12:44:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-loses-command-auguments/m-p/4060901#M737331</guid>
      <dc:creator>Scott Lindstrom_2</dc:creator>
      <dc:date>2007-08-27T12:44:31Z</dc:date>
    </item>
  </channel>
</rss>

