parallel
[Top][All Lists]
Advanced

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

Re: Displaying output of shell script


From: Arun Vimalathithen
Subject: Re: Displaying output of shell script
Date: Wed, 8 Nov 2017 10:09:55 +1100

Hi,

I am already outputting to a file (which I omitted in the pseudo code)
which is working ok. The EXIT_VALUE is there as an accumulation of all
HTTP calls so that the end of the job a user can investigate if there
is a failure.

This job is run as a deployment task in Bamboo and could take some
time as there are a number of calls; in addition the normal users will
not have access to the logs but would need to rely on the output to
the bamboo terminal (page) to view\diagnose the task.

Thanks,

Arun

On Tue, Nov 7, 2017 at 11:39 PM, Joe Sapp <sappj@ieee.org> wrote:
> Hi Arun,
>
> Have you read 
> https://www.gnu.org/software/parallel/parallel_tutorial.html#Saving-output-into-files
> ?  I'm not sure how you would collect one of those file handles (e.g.,
> stderr) onto one terminal for monitoring, but maybe moreutils'
> `sponge` program would help.  You might also want to try --ungroup.
> Should EXIT_VALUE control whether the job succeeded or failed?
>
> Joe
>
> On Mon, Nov 6, 2017 at 8:13 PM, Arun Vimalathithen
> <vimalathithen@gmail.com> wrote:
>> Hi,
>>
>> I have a shell script(s) (generated) that does something calls a bunch
>> of curl commands in a loop and accumulates the HTTP response values to
>> decide the exit value. Something similar to:-
>>
>> EXEC 3>&1
>> EXIT_VALUE=0
>> curl="curl XXXXXXXX"
>> HTTP_STATUS=$curl | parse and get HTTP status
>> MESSAGE="The cmd $curl executed with status $HTTP_STATUS"
>>
>> if [ $HTTP_STATUS -gt 204]
>>   EXIT_VALUE=1
>> fi
>>
>> echo $MESSAGE >&3
>> echo EXIT_VALUE
>>
>> I need the contents of $MESSAGE to be displayed while the script is
>> running as well (for the users to troubleshoot, etc) but I have lost
>> then when I converted the script to be run through GNU parallel.
>>
>> Can someone please give me any pointers on where I am going wrong?
>>
>> Thanks,
>>
>> Arun
>>



reply via email to

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