<?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 command usage in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126284#M717705</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;  (&lt;BR /&gt;&lt;BR /&gt;    Script commands&lt;BR /&gt;&lt;BR /&gt;  ) 1&amp;gt;/tmp/logfile 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Sundar</description>
    <pubDate>Fri, 21 Nov 2003 15:38:59 GMT</pubDate>
    <dc:creator>Sundar_7</dc:creator>
    <dc:date>2003-11-21T15:38:59Z</dc:date>
    <item>
      <title>script command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126282#M717703</link>
      <description>&lt;BR /&gt;Is there any way to force the script command to capture information to a file when a user executes a script?? &lt;BR /&gt;&lt;BR /&gt;We have cases were they are running a normal application script, and either not catching an error or something, but later on saying things didn't work right but have no information from the origional run.&lt;BR /&gt;&lt;BR /&gt;Would like to force the script command to execute without them realizing it or having to do anything so I can check later on when they complain...</description>
      <pubDate>Fri, 21 Nov 2003 15:31:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126282#M717703</guid>
      <dc:creator>MikeL_4</dc:creator>
      <dc:date>2003-11-21T15:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: script command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126283#M717704</link>
      <description>You can actually redirect the standard output to a file:&lt;BR /&gt;&lt;BR /&gt;# script_name &amp;gt; output_file_name&lt;BR /&gt;OR&lt;BR /&gt;# script_name &amp;gt; output_file_name 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;If are talking about the 'script' command, you can capture the output like this:&lt;BR /&gt;&lt;BR /&gt;# script file_name&lt;BR /&gt;&lt;BR /&gt;Now, after this, whatever they type and the result will be stored on this file.</description>
      <pubDate>Fri, 21 Nov 2003 15:35:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126283#M717704</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-11-21T15:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: script command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126284#M717705</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;  (&lt;BR /&gt;&lt;BR /&gt;    Script commands&lt;BR /&gt;&lt;BR /&gt;  ) 1&amp;gt;/tmp/logfile 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Sundar</description>
      <pubDate>Fri, 21 Nov 2003 15:38:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126284#M717705</guid>
      <dc:creator>Sundar_7</dc:creator>
      <dc:date>2003-11-21T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: script command usage</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126285#M717706</link>
      <description>The easiest way is to trace the script every time they run it. To do that, use exec at the beginning to change stderr to a secret file and then start the script, something like this:&lt;BR /&gt; &lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;#&lt;BR /&gt;# log stderr here&lt;BR /&gt;# Use pid and username in filename&lt;BR /&gt;&lt;BR /&gt;MYNAME=${0##*/}&lt;BR /&gt;MYUSER=$(/usr/bin/id -run)&lt;BR /&gt;exec 2&amp;gt; /var/tmp/$MYNAME-$MYUSER-$$.log&lt;BR /&gt;set -x&lt;BR /&gt;&lt;BR /&gt;...rest of script...&lt;BR /&gt; &lt;BR /&gt;Now the script works as before except every step is recorded in the file: scriptname-username-PID.log. Note that as with all scripts, set -x affects the current script and has no effect on functions nor will it report on what an external command might return.&lt;BR /&gt;</description>
      <pubDate>Fri, 21 Nov 2003 16:11:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-command-usage/m-p/3126285#M717706</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-11-21T16:11:30Z</dc:date>
    </item>
  </channel>
</rss>

