<?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: script to sftp using &amp;quot;variable&amp;quot; id in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167889#M681706</link>
    <description>Hi,&lt;BR /&gt;What I understand that you want to send a file to some special users in the same host.&lt;BR /&gt;If this is right then take users name into a file &lt;BR /&gt;#cat myusers&lt;BR /&gt;user1&lt;BR /&gt;user4&lt;BR /&gt;user5&lt;BR /&gt;user8&lt;BR /&gt;&lt;BR /&gt;now at the command prompt or save this code into a file &lt;BR /&gt;#cat myscript  &lt;BR /&gt;for i in `cat myusers`&lt;BR /&gt;do&lt;BR /&gt;scp myfile $i@hostname&lt;BR /&gt;Done&lt;BR /&gt;&lt;BR /&gt;now run this script as&lt;BR /&gt;#sh ./myscript&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
    <pubDate>Fri, 03 Apr 2009 05:08:19 GMT</pubDate>
    <dc:creator>Suraj K Sankari</dc:creator>
    <dc:date>2009-04-03T05:08:19Z</dc:date>
    <item>
      <title>script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167886#M681703</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;In the 'sftp' command, how do I replace the user ID with a variable? &lt;BR /&gt;&lt;BR /&gt;sftp -b scriptname user@host&lt;BR /&gt;&lt;BR /&gt;The "@host" is always the same. Many servers are sending files to this destination - the source user ID varies.&lt;BR /&gt;&lt;BR /&gt;The intention is to use hostname to identify which user to do the sftp. This way, I can use the same script for different systems - just need to add the host and corresponding user id in an 'if-then-else' construct. &lt;BR /&gt;&lt;BR /&gt;Is it possible?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Apr 2009 04:46:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167886#M681703</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-04-03T04:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167887#M681704</link>
      <description>Have you tried simply using $user as you would in a script?&lt;BR /&gt;&lt;BR /&gt;user=MarkM&lt;BR /&gt;&lt;BR /&gt;sftp -b scriptname $user@host&lt;BR /&gt;&lt;BR /&gt;Not near a box to try this at the moment though</description>
      <pubDate>Fri, 03 Apr 2009 04:49:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167887#M681704</guid>
      <dc:creator>Mark McDonald_2</dc:creator>
      <dc:date>2009-04-03T04:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167888#M681705</link>
      <description>&lt;!--!*#--&gt;Uh, same as any other string and any other&lt;BR /&gt;variable?&lt;BR /&gt;&lt;BR /&gt;      user=fred&lt;BR /&gt;      sftp -b scriptname "$user"@host&lt;BR /&gt;&lt;BR /&gt;&amp;gt; The intention is to use hostname to&lt;BR /&gt;&amp;gt; identify which user to do the sftp.&lt;BR /&gt;&lt;BR /&gt;Huh?  Am I dense, or was that unclear?</description>
      <pubDate>Fri, 03 Apr 2009 04:52:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167888#M681705</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-04-03T04:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167889#M681706</link>
      <description>Hi,&lt;BR /&gt;What I understand that you want to send a file to some special users in the same host.&lt;BR /&gt;If this is right then take users name into a file &lt;BR /&gt;#cat myusers&lt;BR /&gt;user1&lt;BR /&gt;user4&lt;BR /&gt;user5&lt;BR /&gt;user8&lt;BR /&gt;&lt;BR /&gt;now at the command prompt or save this code into a file &lt;BR /&gt;#cat myscript  &lt;BR /&gt;for i in `cat myusers`&lt;BR /&gt;do&lt;BR /&gt;scp myfile $i@hostname&lt;BR /&gt;Done&lt;BR /&gt;&lt;BR /&gt;now run this script as&lt;BR /&gt;#sh ./myscript&lt;BR /&gt;&lt;BR /&gt;Suraj</description>
      <pubDate>Fri, 03 Apr 2009 05:08:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167889#M681706</guid>
      <dc:creator>Suraj K Sankari</dc:creator>
      <dc:date>2009-04-03T05:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167890#M681707</link>
      <description>@ mark, your solution worked... thanks...&lt;BR /&gt;&lt;BR /&gt;@ Steven, different host use different user ID to sftp the file, &lt;BR /&gt;that's why I'm using the hostname to identify which user to use... &lt;BR /&gt;e.g. user John in host B12, user Pete in host J29, etc&lt;BR /&gt;&lt;BR /&gt;@Suraj, thanks for the solution...</description>
      <pubDate>Fri, 03 Apr 2009 07:21:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167890#M681707</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-04-03T07:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: script to sftp using "variable" id</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167891#M681708</link>
      <description>solution provided</description>
      <pubDate>Fri, 03 Apr 2009 07:23:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-sftp-using-quot-variable-quot-id/m-p/5167891#M681708</guid>
      <dc:creator>so.nimda</dc:creator>
      <dc:date>2009-04-03T07:23:03Z</dc:date>
    </item>
  </channel>
</rss>

