screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Several problems while trying to make screen automatically start another


From: Kresimir Cosic
Subject: Several problems while trying to make screen automatically start another program.
Date: Wed, 26 Apr 2006 20:47:14 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

Problem 1.
For a test, I made a very simple C program named fooint.cpp:

#include <stdio.h>
main()
{
        int i;
        scanf("%d",&i);
        printf("rez: %d\n",i);
        return 0;
}

and compiled it with:
        g++ -o fooint.exe fooint.cpp

If I try to start it with:
        screen fooint.exe
it works fine.

But, if I try to link it with libmysqlclient (v4.16):
g++ -o fooint2.exe fooint.cpp -L/home/kreso/prog/mysql/lib/mysql -lmysqlclient
screen fooint2.exe
then fooint2.exe doesn't even get executed and I get error message: [the screen is terminating]

Also, this fooint2.exe works normally in every other way, for example if I start screen, and then run fooint2.exe within it, it works properly.

Problem 2.
I tried to get around problem 1. To do that, first I wanted that when starting screen, it gets detached immediately. So I created a file named tdscreenrc.txt, which contains a sinle line with the command 'detach'.

Then I executed:
screen -S tdm -c /home/kreso/tdscreenrc.txt
screen -S tdm -X eval 'stuff "/home/kreso/prog/fooint.exe"\015'
and it works fine.

But then I wanted to make a program that would execute the above two commands automatically:
#include <stdio.h>
#include <stdlib.h>
main()
{
        system("screen -S tdm -c /home/kreso/tdscreenrc.txt");        
system("screen -S tdm -X eval 'stuff \"/home/kreso/prog/fooint.exe\"\\015'");
        return 0;
}

When I run this program, it doesn't work properly. The first system call works fine, the second one doesn't. I haven't got the slightest clue what could possibly be wrong with second call.

Problem 3.
I tried to change the acive window while screen is detached. I created screen named tdm with 2 windows, detached and tried:

screen -S tdm -X next

but that doesn't work (the active window doesn't change). I also tried:

screen -S tdm -X eval 'stuff "screen -X next"\015'

and it also doesn't work.


Any suggestions? I am not very skilled when working with linux, so anything is appreciated.













reply via email to

[Prev in Thread] Current Thread [Next in Thread]