<?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: rsh failing when passing special characters as its argument in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957903#M95013</link>
    <description>&lt;P&gt;rsh on HP-UX is the restricted shell, I assume you mean remsh?&lt;BR /&gt;&lt;BR /&gt;Why are you bothering to use ksh inside a remsh? Are you worried that the user on the other side is using the scummy C shell?&lt;BR /&gt;&lt;BR /&gt;You should be able to use:&lt;BR /&gt;remsh $SERVER_IP -n "cd /opt/abc/efg/; ./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH"&lt;BR /&gt;&lt;BR /&gt;You may have problems if $NAME has a "$" but "_" and "@" should be ok. (Unless "@" is used as erase?)&lt;BR /&gt;&lt;BR /&gt;This will let you pass an embedded "$" to myscript:&lt;BR /&gt;$ NAME='x$x'; remsh $SERVER_IP -n "... ./myscript '$NAME' "&lt;/P&gt;</description>
    <pubDate>Sun, 31 Jul 2011 02:25:07 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-07-31T02:25:07Z</dc:date>
    <item>
      <title>rsh failing whn passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957902#M95012</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I hav a script hich is doing some thing like this ..&lt;BR /&gt;/usr/bin/rsh -n $SERVER_IP "ksh -c \"cd /opt/abc/efg/;./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH&lt;BR /&gt;&lt;BR /&gt;now if the parameter NAME is having some special character in it ( like _ , $, @ ,/) then  rsh is failng &lt;BR /&gt;&lt;BR /&gt;Can an one help me with this &lt;BR /&gt;Regards&lt;BR /&gt;Binu</description>
      <pubDate>Thu, 08 Mar 2007 03:23:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957902#M95012</guid>
      <dc:creator>msbinu</dc:creator>
      <dc:date>2007-03-08T03:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: rsh failing when passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957903#M95013</link>
      <description>&lt;P&gt;rsh on HP-UX is the restricted shell, I assume you mean remsh?&lt;BR /&gt;&lt;BR /&gt;Why are you bothering to use ksh inside a remsh? Are you worried that the user on the other side is using the scummy C shell?&lt;BR /&gt;&lt;BR /&gt;You should be able to use:&lt;BR /&gt;remsh $SERVER_IP -n "cd /opt/abc/efg/; ./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH"&lt;BR /&gt;&lt;BR /&gt;You may have problems if $NAME has a "$" but "_" and "@" should be ok. (Unless "@" is used as erase?)&lt;BR /&gt;&lt;BR /&gt;This will let you pass an embedded "$" to myscript:&lt;BR /&gt;$ NAME='x$x'; remsh $SERVER_IP -n "... ./myscript '$NAME' "&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2011 02:25:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957903#M95013</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-31T02:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: rsh failing whn passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957904#M95014</link>
      <description>Hi Thanks a lot .. it worked .. &lt;BR /&gt;one more doubt .if NAME is having $ remsh will fail ?? can u pls tell me y its like this</description>
      <pubDate>Fri, 09 Mar 2007 06:26:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957904#M95014</guid>
      <dc:creator>msbinu</dc:creator>
      <dc:date>2007-03-09T06:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: rsh failing whn passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957905#M95015</link>
      <description>The shell is interfering with your command line (by design). Your script needs the variables expanded but along with that expansion comes shell interpretation of the results. As always when testing these types of remote execution command lines, use echo to see what is really happening:&lt;BR /&gt; &lt;BR /&gt;echo /usr/bin/rsh -n $SERVER_IP "ksh -c \"cd /opt/abc/efg/;./myscript $NODE $KEY $DISPLAY $NAME $VERSION $PATH&lt;BR /&gt; &lt;BR /&gt;The echo will show you what is REALLY going to processed. If you see special characters in $NAME, then they will also be expanded and interpreted --&amp;gt; on the remote machine's ksh shell.</description>
      <pubDate>Fri, 09 Mar 2007 08:04:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957905#M95015</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2007-03-09T08:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: rsh failing whn passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957906#M95016</link>
      <description>Thnks .. this helps a lot ...what will be the impact of remopving this ksh -c from my command ??? when can this casue a problem</description>
      <pubDate>Fri, 09 Mar 2007 08:39:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957906#M95016</guid>
      <dc:creator>msbinu</dc:creator>
      <dc:date>2007-03-09T08:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: rsh failing when passing special characters as its argument</title>
      <link>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957907#M95017</link>
      <description>&lt;P&gt;&amp;gt;what will be the impact of removing this ksh -c from my command ???&lt;BR /&gt;&lt;BR /&gt;As I said, if your remote system doesn't have the same shell.&lt;BR /&gt;&lt;BR /&gt;The benefit is that you don't have to have an extra level of quoting. It took at least a few minutes to find my solution, adding more levels takes more fiddling.&lt;/P&gt;</description>
      <pubDate>Sun, 31 Jul 2011 02:24:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/rsh-failing-whn-passing-special-characters-as-its-argument/m-p/3957907#M95017</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-31T02:24:18Z</dc:date>
    </item>
  </channel>
</rss>

