in reply to how to sleep-awake on perl script?

Could you elaborate what you mean by "put script to sleep"? Do you intent to keep it running in the background when logging out? Or suspend/resume the process? If so, nohup(1), or your shell's job control (^Z, fg, etc.) might be what you're looking for.

Replies are listed 'Best First'.
Re^2: how to sleep-awake on perl script?
by Anonymous Monk on Apr 24, 2009 at 00:50 UTC
    I cant run the program in bg or nohup.I run this script inetractively-constantly inputing some or the other value-Can't automate it.All I want is to stop the process for few hours and then continue from the point where I stopped. -It's kind of building the output brick-by-brick- some bioinformatics stuff.
      All I want is to stop the process for few hours and then continue from the point where I stopped.

      That's exactly what suspend/resume is for.  To suspend the program, you'd type ^Z (= Ctrl-z)1 while the program is running. Then type bg to send the (stopped) process in the background. To resume it again, type fg (or fg <jobnumber> in case you have several backgrounded — type jobs to list them).

      Have you tried that?  What happens, or doesn't work?

      ___

      1  ^Z is the typical tty setting. Type stty -a to see what yours is set to — mine shows "susp = ^Z", for example (among other stuff)

        I cant run the program in bg or nohup.

      What do you mean you cannot run nohup? Run your interactive script this way:
      $ nohup myscript.pl arg1 arg2

      When you need a break, hit Ctrl-Z and that will suspend your interactive program. Record the PID number and logoff. When you logon again in the future, do:
      $ fg PID

      Google helps.
        ...or even (to save recording &/or remembering the PID on ksh/bash shells), when logging back on...
        > # list the currently running jobs (including your suspended job) > jobs > # select the appropriate job number > fg %<job num>

        A user level that continues to overstate my experience :-))