amir
amir

Reputation: 1

How to run screen using bash script

I am developing an application on Linux CentOS server. I need to automatically after registration of each use server create a screen to run some codes in loop for user.

When I use bash script to create new screen, it can't open screen and run commands in that screen.

For example, I want to open an screen and I run a php file in that screen. I have created a bash script test.sh but when I run this using cron tab it doesn't work.

screen
php php.php

Please tell what can I do to solve this?

Upvotes: 0

Views: 1306

Answers (1)

Bayou
Bayou

Reputation: 3441

It's quite easy to do this and such a thread already exists.

screen -d -m yourcommand

Upvotes: 1

Related Questions