help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Fwd: Proper use of nohup within here-document?


From: Mun
Subject: Re: [Help-bash] Fwd: Proper use of nohup within here-document?
Date: Thu, 22 Mar 2018 12:04:20 -0700

Hi Greg,

My here-document looks something like this:

========================================
cat >myScript <<@EOF
#! /bin/bash

date > showMe.txt
nohup gxmessage -timeout 0 -file showMe.txt > /dev/null 2>&1 &

@EOF

chmod 777 myScript
qsub -b yes -sync n ./myScript
========================================

Note the last line with the qsub command.  The whole purpose of the
here-document is to package up a set of commands into a script form
that will be dispatched to another server for execution using a "grid"
tool (aka load sharing facility).

The commands run fine except I can't figure out a way for gxmessage to
not die when myScript exits.

Thanks,

-- 
Mun


On Thu, Mar 22, 2018 at 11:40 AM, Greg Wooledge <address@hidden> wrote:
> On Thu, Mar 22, 2018 at 11:29:11AM -0700, Mun wrote:
>> Within the here-document I'm essentially calling gxmessage thusly:
>> $ nohup gxmessage -timeout 0 -file abc.txt > /dev/null 2>&1 &
>>
>> Any ideas on how I can allow the here-document to exit but allow the
>> gxmessage process to live on?
>
> I think you will need to show us this alleged "here-document".
> Here-documents don't normally execute commands, and certainly not using
> that syntax.
>
> This is a here-document:
>
>
> cat <<'xxx'
> usage: myscript [-abqz] weight beauty
>
> Specify weight in decapounds, and beauty in microhelens.
> xxx
>
>
> The only way you can normally execute a command during the reading of
> a here-document would be with a command substitution, using an unquoted
> here-document sentinel word.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]