<?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: rcp with variable filename in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982257#M420089</link>
    <description>Try:&lt;BR /&gt;&lt;BR /&gt;cd /local/directory&lt;BR /&gt;rcp remote_host:/folder/${filename} .&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
    <pubDate>Thu, 01 Jun 2006 08:32:58 GMT</pubDate>
    <dc:creator>Geoff Wild</dc:creator>
    <dc:date>2006-06-01T08:32:58Z</dc:date>
    <item>
      <title>rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982250#M420082</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'm writing a script to remotely copy a file from a non-unix server. As the filename is not fixed, I'm trying to use a variable to do that.&lt;BR /&gt;&lt;BR /&gt;Here's the command that I'm using :&lt;BR /&gt;rcp remote_host:'\folder\$filename' $filename&lt;BR /&gt;&lt;BR /&gt;Executing this resulted in error "The system cannot find the file specified."&lt;BR /&gt;&lt;BR /&gt;How can I correct this?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;:)</description>
      <pubDate>Thu, 01 Jun 2006 03:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982250#M420082</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T03:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982251#M420083</link>
      <description>Hi,&lt;BR /&gt;try to remove the "'" symbol.&lt;BR /&gt;&lt;BR /&gt;The rcp work fine with the name of the file?&lt;BR /&gt;&lt;BR /&gt;Enrico</description>
      <pubDate>Thu, 01 Jun 2006 03:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982251#M420083</guid>
      <dc:creator>Enrico P.</dc:creator>
      <dc:date>2006-06-01T03:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982252#M420084</link>
      <description>Hi Enrico,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply.&lt;BR /&gt;&lt;BR /&gt;If the quotation is removed, it will not work. I need to speciy the full path.&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Thu, 01 Jun 2006 04:04:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982252#M420084</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T04:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982253#M420085</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;shouldn't &lt;BR /&gt;rcp remote_host:'\folder\$filename' .&lt;BR /&gt;work also?&lt;BR /&gt;&lt;BR /&gt;So how do you want to set $filename?&lt;BR /&gt;&lt;BR /&gt;Volkmar&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Jun 2006 04:12:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982253#M420085</guid>
      <dc:creator>V. Nyga</dc:creator>
      <dc:date>2006-06-01T04:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982254#M420086</link>
      <description>Hi,&lt;BR /&gt;try to substitute the single quota ' with the double quota ". The single quota not interpreted the $filename:&lt;BR /&gt;&lt;BR /&gt;FILE=test&lt;BR /&gt;echo "$FILE"&lt;BR /&gt;test&lt;BR /&gt;echo $FILE&lt;BR /&gt;test&lt;BR /&gt;echo '$file'&lt;BR /&gt;$file&lt;BR /&gt;&lt;BR /&gt;Enrico</description>
      <pubDate>Thu, 01 Jun 2006 04:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982254#M420086</guid>
      <dc:creator>Enrico P.</dc:creator>
      <dc:date>2006-06-01T04:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982255#M420087</link>
      <description>Single quotes ' (apostrophe) disable all variables witin the quotes. So the result sent to the remote host is \folder\$filename and not \folder\myfile or whatever filename you want. Now it's important to note that the reverse slash \ has a special meaning to your shell, so it is removed automatically and the next character is used without any special meaning -- it is called the escape character to escape any special meaning of the next character.&lt;BR /&gt; &lt;BR /&gt;So escape the escape character like this:&lt;BR /&gt; &lt;BR /&gt;rcp remote_host:\\folder\\$filename $filename&lt;BR /&gt; &lt;BR /&gt;and now it should work as you expect. Copying files and executing remote commands between very different computers requires careful attention to special characters.</description>
      <pubDate>Thu, 01 Jun 2006 07:16:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982255#M420087</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-06-01T07:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982256#M420088</link>
      <description>Here's some additional eval. of rcp commands since the file transfer looks good by Mr. H.&lt;BR /&gt;&lt;BR /&gt;rcpinfo -p master/client&lt;BR /&gt;&lt;BR /&gt;check for these daemons,&lt;BR /&gt;&lt;BR /&gt;rpcbind, status, nfs, mountd, nlockmgr, llockmgr&lt;BR /&gt;&lt;BR /&gt;Note:  unless your on something older like 10.20.</description>
      <pubDate>Thu, 01 Jun 2006 07:48:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982256#M420088</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-06-01T07:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982257#M420089</link>
      <description>Try:&lt;BR /&gt;&lt;BR /&gt;cd /local/directory&lt;BR /&gt;rcp remote_host:/folder/${filename} .&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Thu, 01 Jun 2006 08:32:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982257#M420089</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2006-06-01T08:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982258#M420090</link>
      <description>thanks all, for the replies...&lt;BR /&gt;&lt;BR /&gt;will give it a try...</description>
      <pubDate>Thu, 01 Jun 2006 19:02:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982258#M420090</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T19:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982259#M420091</link>
      <description>Has anyone out there ever rcp a file from a windwows 2003 server?&lt;BR /&gt;&lt;BR /&gt;The scenario is this :&lt;BR /&gt;&lt;BR /&gt;I'm trying to copy a file (has no fixed filename, hence the variable) from a Windows 2003 server to a UX machine.&lt;BR /&gt;&lt;BR /&gt;The UX machine initiates the pulling of this file.&lt;BR /&gt;&lt;BR /&gt;After trying all the helpful suggestion, I realise that Windows 2003 server may not understand the $filename UX variable.&lt;BR /&gt;&lt;BR /&gt;Has anyone out there done something similar?&lt;BR /&gt;&lt;BR /&gt;Any help is much appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks !  :)&lt;BR /&gt;</description>
      <pubDate>Thu, 01 Jun 2006 19:51:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982259#M420091</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T19:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982260#M420092</link>
      <description>Here you go.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rcp.mspx?mfr=true" target="_blank"&gt;http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/rcp.mspx?mfr=true&lt;/A&gt;</description>
      <pubDate>Thu, 01 Jun 2006 19:55:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982260#M420092</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2006-06-01T19:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982261#M420093</link>
      <description>It's important to understand how the command line works in a shell. When you include something like $filename, that is not what will be sent to the Windows box. Instead, the shell preprocesses every command line to substitute the contents of variables, evaluate $(..) and other substitutions. To see how this works, just put echo in front of your command:&lt;BR /&gt; &lt;BR /&gt;echo rcp remote_host:'\folder\$filename' $filename&lt;BR /&gt; &lt;BR /&gt;Now you will see what the real command looks like. The single quotes are very special in that they turn off special character processing inside the single quotes. Do this instead:&lt;BR /&gt; &lt;BR /&gt;echo rcp remote_host:"\folder\$filename" $filename&lt;BR /&gt; &lt;BR /&gt;As you will see, double quotes will expand $variable names to their contents.&lt;BR /&gt; &lt;BR /&gt;So you see that the Windows server never sees the $filename unless you use the single quotes to turn off the special processing. And of course $filename is meaningless to Windows (or any other remote computer).&lt;BR /&gt; &lt;BR /&gt;There is another Windows 'feature' concerning directories. You sometimes have to double the backslashes, something like this: \\folder\\$filename. To eliminate the Windows ' path problems, try getting a file from the base disk as in: C:$filename</description>
      <pubDate>Thu, 01 Jun 2006 20:12:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982261#M420093</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2006-06-01T20:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982262#M420094</link>
      <description>Hi Bill,&lt;BR /&gt;&lt;BR /&gt;Thanks for the very detailed explanation.&lt;BR /&gt;&lt;BR /&gt;I now have a better idea of how the single and double quotes work.&lt;BR /&gt;&lt;BR /&gt;And your tip worked !!&lt;BR /&gt;&lt;BR /&gt;Appreciate your help !&lt;BR /&gt;&lt;BR /&gt;Cheers !!</description>
      <pubDate>Thu, 01 Jun 2006 20:20:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982262#M420094</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T20:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: rcp with variable filename</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982263#M420095</link>
      <description>Bill provided the solution.&lt;BR /&gt;&lt;BR /&gt;Great job, Bill !</description>
      <pubDate>Thu, 01 Jun 2006 20:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rcp-with-variable-filename/m-p/4982263#M420095</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2006-06-01T20:21:35Z</dc:date>
    </item>
  </channel>
</rss>

