<?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: nohup - capturing the return value from the command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724345#M945618</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;From man nohup&lt;BR /&gt;&lt;BR /&gt;nohup executes command with hangups and quits ignored.  If output is   &lt;BR /&gt;not redirected by the user, both standard output and standard error    &lt;BR /&gt;are sent to nohup.out.  If nohup.out is not writable in the current    &lt;BR /&gt;directory, output is redirected to $HOME/nohup.out; otherwise, nohup   &lt;BR /&gt;fails. If a file is created, the file's permission bits will be set to &lt;BR /&gt;S_IRUSR | S_IWUSR.                                                     &lt;BR /&gt;                                                                       &lt;BR /&gt;If output from nohup is redirected to a terminal, or is not redirected &lt;BR /&gt;at all, the output is sent to nohup.out.                               &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So:- &lt;BR /&gt;&lt;BR /&gt;nohup {filename] &amp;gt;log.file &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 15 May 2002 11:45:33 GMT</pubDate>
    <dc:creator>Paula J Frazer-Campbell</dc:creator>
    <dc:date>2002-05-15T11:45:33Z</dc:date>
    <item>
      <title>nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724343#M945616</link>
      <description>Is there a way to execute a command in the background using nohup and capture the return value of the command. I've tried the following:&lt;BR /&gt;&lt;BR /&gt;nohup (command; echo $? &amp;gt;rv.out) &amp;amp;&lt;BR /&gt;&lt;BR /&gt;but I receive a syntax error:&lt;BR /&gt;&lt;BR /&gt;sh: Syntax error: '(' is not expected&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 11:34:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724343#M945616</guid>
      <dc:creator>Paul Ammirata</dc:creator>
      <dc:date>2002-05-15T11:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724344#M945617</link>
      <description>Hi Paul,&lt;BR /&gt;&lt;BR /&gt;Try $? after the nohup command. This will return the exit code for the command run using nohup,&lt;BR /&gt;&lt;BR /&gt;nohup command;echo $?&lt;BR /&gt;&lt;BR /&gt;do a "man nohup" for more info.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 11:43:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724344#M945617</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2002-05-15T11:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724345#M945618</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;From man nohup&lt;BR /&gt;&lt;BR /&gt;nohup executes command with hangups and quits ignored.  If output is   &lt;BR /&gt;not redirected by the user, both standard output and standard error    &lt;BR /&gt;are sent to nohup.out.  If nohup.out is not writable in the current    &lt;BR /&gt;directory, output is redirected to $HOME/nohup.out; otherwise, nohup   &lt;BR /&gt;fails. If a file is created, the file's permission bits will be set to &lt;BR /&gt;S_IRUSR | S_IWUSR.                                                     &lt;BR /&gt;                                                                       &lt;BR /&gt;If output from nohup is redirected to a terminal, or is not redirected &lt;BR /&gt;at all, the output is sent to nohup.out.                               &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So:- &lt;BR /&gt;&lt;BR /&gt;nohup {filename] &amp;gt;log.file &amp;amp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 11:45:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724345#M945618</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-05-15T11:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724346#M945619</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;You want to put your command in a script&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh!&lt;BR /&gt;&lt;BR /&gt;nohup &lt;COMMAND&gt;&lt;BR /&gt;&lt;BR /&gt;if [ $? = 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "echo command succesful" &amp;gt; /tmp/log&lt;BR /&gt;else&lt;BR /&gt;echo "command unsuccesful" &amp;gt; /tmp/errors&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Steve&lt;/COMMAND&gt;</description>
      <pubDate>Wed, 15 May 2002 11:46:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724346#M945619</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-05-15T11:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724347#M945620</link>
      <description>Hi Paul,&lt;BR /&gt;&lt;BR /&gt;Some more information on what you are trying to achieve would be useful...&lt;BR /&gt;&lt;BR /&gt;However, as per 'man nohup', nohup will not accept a list of commands. You have to write a shell script to run the commands and nohup the script.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;John</description>
      <pubDate>Wed, 15 May 2002 11:47:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724347#M945620</guid>
      <dc:creator>John Palmer</dc:creator>
      <dc:date>2002-05-15T11:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724348#M945621</link>
      <description>The following: &lt;BR /&gt;&lt;BR /&gt;nohup command;echo $? &lt;BR /&gt;&lt;BR /&gt;works for commands executed in the foreground, but I want to execute the command in the background.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 12:11:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724348#M945621</guid>
      <dc:creator>Paul Ammirata</dc:creator>
      <dc:date>2002-05-15T12:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: nohup - capturing the return value from the command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724349#M945622</link>
      <description>While the man page states:&lt;BR /&gt;&lt;BR /&gt;nohup will not accept a list of commands. You have to write a shell script to run the commands and nohup the script. &lt;BR /&gt;&lt;BR /&gt;It also states:&lt;BR /&gt;&lt;BR /&gt;Be careful to place punctuation properly. For example, in the command form:&lt;BR /&gt;&lt;BR /&gt;nohup command1; command2&lt;BR /&gt;&lt;BR /&gt;nohup applies only to command1. To correct the problem, use the command form:&lt;BR /&gt;&lt;BR /&gt;nohup (command1; command2)&lt;BR /&gt;&lt;BR /&gt;***&lt;BR /&gt;&lt;BR /&gt;I wish to capture the return value from the command that runs nohup in the background.&lt;BR /&gt;</description>
      <pubDate>Wed, 15 May 2002 12:34:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nohup-capturing-the-return-value-from-the-command/m-p/2724349#M945622</guid>
      <dc:creator>Paul Ammirata</dc:creator>
      <dc:date>2002-05-15T12:34:19Z</dc:date>
    </item>
  </channel>
</rss>

