Is there a way wherein we can start a screen, execute a command and detach it without actually entering into the screen? something like

screen -[some option] [command tobe executed]

I need this because i have about 100 files that each have different input files and i need to run each on a screen and if the above is possible all i need to do is create a shell script..

Is there an option in screen that would let me do this?

link|improve this question
feedback

migrated from stackoverflow.com May 20 '11 at 3:11

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 0 down vote accepted

You can run screen in detached mode by using the -d -m option, eg.

screen -d -m some_cmd
link|improve this answer
thanks.. but what if i want to redirect the output to a file? like screen -d -m sudo ./mycode &>output but this just gives a blank file and the output is actually displayed inside the screen.. – Prasanth Madhavan May 20 '11 at 7:28
feedback

Try tmux (http://tmux.sourceforge.net/). It is much more suited to be used in this manner. Screen is optimized for interactive usage.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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