<?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: Exit from script to a .txt file..It does not work in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004124#M98498</link>
    <description>Hi Hayse,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;program_to_execute&lt;BR /&gt;echo $? &amp;gt;&amp;gt; result.txt&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;PCS</description>
    <pubDate>Tue, 19 Sep 2006 10:53:28 GMT</pubDate>
    <dc:creator>spex</dc:creator>
    <dc:date>2006-09-19T10:53:28Z</dc:date>
    <item>
      <title>Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004123#M98497</link>
      <description>Hello everybody&lt;BR /&gt;I am developing a script to verify that a process has being executed and I'm sending the exit to a .txt file , the script for some motive not writing this one in the .txt file Someone will be able to help me with this? Please &lt;BR /&gt;Thank you</description>
      <pubDate>Tue, 19 Sep 2006 10:48:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004123#M98497</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T10:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004124#M98498</link>
      <description>Hi Hayse,&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;program_to_execute&lt;BR /&gt;echo $? &amp;gt;&amp;gt; result.txt&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Tue, 19 Sep 2006 10:53:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004124#M98498</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-09-19T10:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004125#M98499</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;It would be helpful to post your script.  However, in general, all you should need is something like:&lt;BR /&gt;&lt;BR /&gt;# ./myscript; echo $? &amp;gt; ./myscript.returnval&lt;BR /&gt;&lt;BR /&gt;Make sure that you have permission to write into the directory that will hold the file containing the script's return value.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Sep 2006 10:54:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004125#M98499</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-19T10:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004126#M98500</link>
      <description>Hi,&lt;BR /&gt;you can check the status of a script with $?&lt;BR /&gt;&lt;BR /&gt;so:&lt;BR /&gt;/usr/sbin/fbackup -nAvf /dev/rmt/0m -s -g $GRAPH_DIR/graph &amp;gt;&amp;gt; $LOG_FILE 2&amp;gt;&amp;amp;1&lt;BR /&gt;STATUS=$?&lt;BR /&gt;if [ $STATUS != 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "error has occurred"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Sep 2006 10:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004126#M98500</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-19T10:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004127#M98501</link>
      <description>Thanks &lt;BR /&gt;But&lt;BR /&gt;When I execute manually the script, the .txt file is update, the script is in a cron, when he script is executed from cron file, the .txt file is not update</description>
      <pubDate>Tue, 19 Sep 2006 12:45:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004127#M98501</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T12:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004128#M98502</link>
      <description>Hi (again):&lt;BR /&gt;&lt;BR /&gt;Cron's environment is very sparse.  That is, all you are provided for a PATH is:&lt;BR /&gt;&lt;BR /&gt;PATH=/usr/bin:/usr/sbin:.&lt;BR /&gt;&lt;BR /&gt;Hence, unless you explicitly declare the PATH and any other variables you need in your script, then that's all you get!  Have a look at the 'crontab(1)' manpages for more information.&lt;BR /&gt;&lt;BR /&gt;One other mis-used technique often seen is to source (read) your profile in the crontab before executing your script.  This is a poor choice for a variety of reasons.  I suggest that you declare all of the environmental variables you need either in your script or in a file that you source (read) in your script.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 19 Sep 2006 12:58:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004128#M98502</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-19T12:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004129#M98503</link>
      <description>Hayse,&lt;BR /&gt;&lt;BR /&gt;If you are comfortable with supplying your script, I'm sure we can point out the exact error.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Tue, 19 Sep 2006 13:07:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004129#M98503</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-09-19T13:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004130#M98504</link>
      <description>Hi, this is the content of my script...&lt;BR /&gt;HORA=$(date)&lt;BR /&gt;echo $HORA &amp;gt; file.txt&lt;BR /&gt;ps -ef | grep -v grep | grep svr &amp;gt; /dev/null 2&amp;gt; /dev/null&lt;BR /&gt;if [ "$?" -eq 0 ] &lt;BR /&gt;then&lt;BR /&gt;   echo "================" &amp;gt;&amp;gt; file.txt&lt;BR /&gt;   echo " Executing     " &amp;gt;&amp;gt; file.txt &lt;BR /&gt;echo "===================" &amp;gt;&amp;gt; file.txt&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;   echo "===============" &amp;gt;&amp;gt; file.txt&lt;BR /&gt;   echo "NOT Executing  " &amp;gt;&amp;gt; file.txt&lt;BR /&gt;   echo "===============" &amp;gt;&amp;gt; file.txt&lt;BR /&gt;   su - user -c "/home/user/start_service.sh"&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;exit</description>
      <pubDate>Tue, 19 Sep 2006 13:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004130#M98504</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T13:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004131#M98505</link>
      <description>Ahhh &lt;BR /&gt;My script first line:&lt;BR /&gt;#!/bin/sh</description>
      <pubDate>Tue, 19 Sep 2006 13:20:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004131#M98505</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T13:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004132#M98506</link>
      <description>I believe a line like this at the start of the script (after setting the variables) will work:&lt;BR /&gt;&lt;BR /&gt;exec &amp;gt; $LOG_FILE 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;That will write std out and std err to $LOG_FILE&lt;BR /&gt;&lt;BR /&gt;Hope that helps.</description>
      <pubDate>Tue, 19 Sep 2006 13:45:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004132#M98506</guid>
      <dc:creator>Chris Hendrick_2</dc:creator>
      <dc:date>2006-09-19T13:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004133#M98507</link>
      <description>Thanks all of you...&lt;BR /&gt;I solved the problem&lt;BR /&gt;A little detail with PATH&lt;BR /&gt;&lt;BR /&gt;Bye and Thanks&lt;BR /&gt;; )</description>
      <pubDate>Tue, 19 Sep 2006 15:21:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004133#M98507</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T15:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004134#M98508</link>
      <description>Regards</description>
      <pubDate>Tue, 19 Sep 2006 15:22:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004134#M98508</guid>
      <dc:creator>hboo</dc:creator>
      <dc:date>2006-09-19T15:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Exit from script to a .txt file..It does not work</title>
      <link>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004135#M98509</link>
      <description>&amp;gt;ps -ef | grep -v grep | grep svr &amp;gt; /dev/null 2&amp;gt; /dev/null&lt;BR /&gt;&lt;BR /&gt;There is no need to redirect the grep output to /dev/null if you use grep -q.</description>
      <pubDate>Tue, 19 Sep 2006 19:22:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/exit-from-script-to-a-txt-file-it-does-not-work/m-p/5004135#M98509</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2006-09-19T19:22:39Z</dc:date>
    </item>
  </channel>
</rss>

