<?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: unix command inside expect in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200952#M166598</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I assume you are trying to store the date in a variable. Try this :-&lt;BR /&gt;&lt;BR /&gt;# set file1=`date +%m%d%y`&lt;BR /&gt;# echo $file1&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
    <pubDate>Tue, 24 Feb 2004 12:24:09 GMT</pubDate>
    <dc:creator>David Burgess</dc:creator>
    <dc:date>2004-02-24T12:24:09Z</dc:date>
    <item>
      <title>unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200951#M166597</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How to run unix command and store the output in a variable?&lt;BR /&gt;&lt;BR /&gt;set file1 `/tmp/data +%m%d%y`&lt;BR /&gt;&lt;BR /&gt;above syntax not working. Any help would be appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 24 Feb 2004 12:18:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200951#M166597</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2004-02-24T12:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200952#M166598</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I assume you are trying to store the date in a variable. Try this :-&lt;BR /&gt;&lt;BR /&gt;# set file1=`date +%m%d%y`&lt;BR /&gt;# echo $file1&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 24 Feb 2004 12:24:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200952#M166598</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-02-24T12:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200953#M166599</link>
      <description>result=$(command)&lt;BR /&gt; &lt;BR /&gt;However, in your case I think you want&lt;BR /&gt; &lt;BR /&gt;file1="/tmp/data"$(date +%m%d%y)</description>
      <pubDate>Tue, 24 Feb 2004 12:24:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200953#M166599</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-02-24T12:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200954#M166600</link>
      <description>Mark,&lt;BR /&gt;&lt;BR /&gt;Is he using csh?&lt;BR /&gt;&lt;BR /&gt;So would it be something like :-&lt;BR /&gt;&lt;BR /&gt;set file1="/tmp/data"`date +%m%d%y`&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Dave.</description>
      <pubDate>Tue, 24 Feb 2004 12:29:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200954#M166600</guid>
      <dc:creator>David Burgess</dc:creator>
      <dc:date>2004-02-24T12:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200955#M166601</link>
      <description>Guys,&lt;BR /&gt;&lt;BR /&gt;My question was unix command inside expect script not in shell script.Your suggestion didn't work.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Tue, 24 Feb 2004 12:32:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200955#M166601</guid>
      <dc:creator>SAM_24</dc:creator>
      <dc:date>2004-02-24T12:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: unix command inside expect</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200956#M166602</link>
      <description>What do you want to do with the variable?&lt;BR /&gt;&lt;BR /&gt;Use it after the expect script ends - or during?&lt;BR /&gt;&lt;BR /&gt;It might be easier to run your unix command and output redirect to a logfile?&lt;BR /&gt;&lt;BR /&gt;Usually in expect - it is command, then response....&lt;BR /&gt;&lt;BR /&gt;IE:&lt;BR /&gt;&lt;BR /&gt;# remove all of the files after mgetting them&lt;BR /&gt;send_user "Removing Remote Files:\n"&lt;BR /&gt;expect "sftp&amp;gt;"&lt;BR /&gt;send -- "rm *\r"&lt;BR /&gt;expect "sftp&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;send -- "\r\n"&lt;BR /&gt;expect "sftp&amp;gt;"&lt;BR /&gt;send -- "quit\r"&lt;BR /&gt;&lt;BR /&gt;# close the log file&lt;BR /&gt;log_file&lt;BR /&gt;expect eof&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Tue, 24 Feb 2004 12:45:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/unix-command-inside-expect/m-p/3200956#M166602</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2004-02-24T12:45:18Z</dc:date>
    </item>
  </channel>
</rss>

