Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

is there a solaris equivalent to the linux screen command?

Example how to use the screen command in Linux

  example for linux :  screen -D -m   ./run_some_script.pl 


  example for Solaris : ?

Man page for screen command for Linux: http://www.oreillynet.com/linux/cmd/cmd.csp?path=s/screen

share|improve this question
    
What do you mean? Is GNU Screen not installed? If it doesn't, then find a package, or download the source and install it. gnu.org/s/screen –  Zoredache Nov 21 '11 at 23:32
    
@Zoredache see my update –  Diana Nov 21 '11 at 23:45
    
Your update didn't really change anything. Screen is a piece of software, it can be install onto Solaris. –  Zoredache Nov 22 '11 at 0:04
    
@Zoredache The Solaris system belong to the customer ( BANK company) and he didn’t want to make on the Solaris system any installation changes , so I only ask if we can find similar command for screen that already exist in Solaris - thx for your advice this is critical subject –  Diana Nov 22 '11 at 0:17
    
Perhaps you can update your question with details about the specific version of Solaris that was Installed? I have almost zero familiarity, but I would expect there are differences in what packages are installed by default. Knowing what version is install may help someone else tell you want exactly is available, or at least what it would take to install screen or an alternative. –  Zoredache Nov 22 '11 at 0:43

3 Answers 3

up vote 3 down vote accepted

As a substitute for screen, if you want to be able to run the process in the background without having it shutdown when you exit the server (or drop your connection), then there are few options:

  • Run the process in a subshell like so:

    (myprog -opts &)

  • Disown the process (if you have bash or zsh) after putting it in the background:

    myprog -opts & ; disown

  • Run the script with nohup:

    nohup ./myprog 2>&1 &

In most of the above cases, the process is detached from the user and put under "init". That meant you can safely exit without the process getting shutdown (otherwise, exiting the shell will send a SIGHUP to the program, which will shut it down).

However, you will not be able to reattach to that process. So for whatever program you run using the above options, you'll need to write standard output to file like so (for example, this):

nohup ./myprog  2>&1>myprog.log &

And then monitor that file.

share|improve this answer
    
where to put the myprog in the syntax nohup find / 2>&1>found.log & –  Diana Nov 22 '11 at 5:10
    
I updated the last example to make it more clearer. –  Rilindo Nov 22 '11 at 14:29

GNU screen is not a linux tool, it is a GNU tool, that is commonly included on Linux, but it is also commonly found on BSD, OSX, and *nix. It should be trivial to install it onto Solaris, and there is probably a package available already.

An alternative to GNU screen is called tmux. Though I believe this is less common.

share|improve this answer
    
Just ran this on a Solaris 10 box: screen -v, output: Screen version 4.00.02 (FAU) 5-Dec-03 –  Kenny Rasschaert Nov 22 '11 at 7:55

If you must install screen for Solaris you can get it from OpenCSW.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.