Author Topic: printing environment variables in stdout  (Read 2672 times)

bijuramavfx

  • Sr. Member
  • ****
  • Posts: 40
printing environment variables in stdout
« on: August 10, 2012, 06:51:01 PM »
Hi there:

Is it possible to print the environment variables in the stdout tab in Qube GUI before running a job ..?

Thanks
/Biju

bijuramavfx

  • Sr. Member
  • ****
  • Posts: 40
Re: printing environment variables in stdout
« Reply #1 on: August 10, 2012, 07:02:32 PM »
Hi there:

How do I specify to run env command(Linux) to output the env. variables to output tab before executing a job ..?

Thanks

BrianK

  • Hero Member
  • *****
  • Posts: 107
Re: printing environment variables in stdout
« Reply #2 on: August 14, 2012, 03:44:06 PM »
Before running the job?  hmmm...  You could modify the command template so that it looks something like:

Code: [Select]
set && <original command template>
That will print out the environment and then immediately run the job.  Printing out the env will have 0 effect on the job & will only change things by bloating the logs with the env prior to job starting.

If you're trying to take action based on the env, you could potentially run a script prior to the job by doing something similar:

Code: [Select]
my_script && <original command template>
if my_script returns non-zero, the original command template will not run & the frame/agenda will be considered a failure.  For example, if my_script looked like this:

Code: [Select]
#!/bin/sh

exit 1

no frame/agenda wil ever run.  You could, then, put some logic in the script to control how it exits & therefore control if/when the frame/agenda starts running.