nohup VERBOSE=1 perl script.pl

前端 未结 3 1504
[愿得一人]
[愿得一人] 2021-01-04 01:58

I have a perl script for which ENV variables can be set to direct specific outputs e.g. $debug, $verbose, $develop etc

Usually I run these from the command line

相关标签:
3条回答
  • 2021-01-04 02:08

    Try to combine all commands into shell script and run it like that: nohup /path/to/script.sh

    Or you could use export: export VERBOSE=1 And then: nohup perl myperlscript.pl params

    0 讨论(0)
  • 2021-01-04 02:14

    Set the environment variable before calling nohup, and it will be preserved when nohup exec()s (replaces itself with) perl.

    $ VERBOSE=1 nohup perl myscript.pl params ...
    
    0 讨论(0)
  • 2021-01-04 02:22

    This is exactly what the env command is for:

    $ env VAR1=VAL1 VAR2=VAL2 nohup perl myperlscript.pl params &
    
    0 讨论(0)
提交回复
热议问题