• php exec('jsexec')

    From Mortifis@VERT/EPHRAM to All on Fri Jun 12 11:04:57 2020
    I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah', $result); but it does not return any result ... even exec('/sbbs/exec/jsexec -v', $result); does return a result ... but exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ... possible jsexec is doing something to stdout?

    Thanks

    ~Mortifis

    ---
    ■ Synchronet ■ Realm of Dispair BBS - http://ephram.synchro.net:82
  • From Digital Man@VERT to Mortifis on Fri Jun 12 10:45:20 2020
    Re: php exec('jsexec')
    By: Mortifis to All on Fri Jun 12 2020 11:04 am

    I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah', $result); but it does not return any result ... even exec('/sbbs/exec/jsexec -v', $result); does return a result ... but exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ... possible jsexec is doing something to stdout?

    You would to execute a script that writes to stdout (e.g. with "write", "writeln" methods). The status output of jsexec won't be captured by your php script since jsexec knows it's not being run from a console, it redirects status messages to /dev/null.

    digital man

    Synchronet/BBS Terminology Definition #87:
    UTF-8 = 8-bit Unicode Transformation Format
    Norco, CA WX: 75.2°F, 63.0% humidity, 2 mph E wind, 0.00 inches rain/24hrs
    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/EPHRAM to Digital Man on Fri Jun 12 18:47:20 2020
    Re: php exec('jsexec')
    By: Mortifis to All on Fri Jun 12 2020 11:04 am

    I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah', $result); but it does not return any result ... even exec('/sbbs/exec/jsexec -v', $result); does return a result ... but exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ... possible jsexec is doing something to stdout?

    You would to execute a script that writes to stdout (e.g. with "write", "writeln" methods). The status output of jsexec won't be captured by your php script since jsexec knows it's not being run from a console, it redirects status messages to /dev/null.

    digital man

    my test php script gets no $response :

    <?php
    exec('/sbbs/exec/jsexec mytest.js "Hello World"', $response);

    foreach($response as $key => $value) {
    echo "key $key - value $value<br>";
    }



    mytest.js:

    load("sbbsdefs.js");

    function dump_objs(obj) {
    Object.keys(obj).forEach(function (e) {
    writeln( e + ': ' + JSON.stringify(obj[e]));
    });
    }

    if(!argv[0])
    writeln('No argumants ... aborting ');
    else
    dump_objs(argv);

    any ideas?

    ---
    ■ Synchronet ■ Realm of Dispair BBS - http://ephram.synchro.net:82
  • From Digital Man@VERT to Mortifis on Sun Jun 14 14:59:21 2020
    Re: Re: php exec('jsexec')
    By: Mortifis to Digital Man on Fri Jun 12 2020 06:47 pm

    Re: php exec('jsexec')
    By: Mortifis to All on Fri Jun 12 2020 11:04 am

    I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah', $result); but it does not return any result ... even exec('/sbbs/exec/jsexec -v', $result); does return a result ... but exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ... possible jsexec is doing something to stdout?

    You would to execute a script that writes to stdout (e.g. with "write", "writeln" methods). The status output of jsexec won't be captured by your php script since jsexec knows it's not being run from a console, it redirects status messages to /dev/null.

    digital man

    my test php script gets no $response :

    <?php
    exec('/sbbs/exec/jsexec mytest.js "Hello World"', $response);

    foreach($response as $key => $value) {
    echo "key $key - value $value<br>";
    }



    mytest.js:

    load("sbbsdefs.js");

    function dump_objs(obj) {
    Object.keys(obj).forEach(function (e) {
    writeln( e + ': ' + JSON.stringify(obj[e]));
    });
    }

    if(!argv[0])
    writeln('No argumants ... aborting ');
    else
    dump_objs(argv);

    any ideas?

    Nope, no ideas. I never tried executing jsexec from PHP.

    digital man

    This Is Spinal Tap quote #35:
    Jeanine Pettibone: You don't do heavy metal in Dubly, you know.
    Norco, CA WX: 82.1°F, 39.0% humidity, 14 mph ENE wind, 0.00 inches rain/24hrs ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Mortifis@VERT/EPHRAM to Digital Man on Sun Jun 14 20:13:03 2020
    Re: Re: php exec('jsexec')
    By: Mortifis to Digital Man on Fri Jun 12 2020 06:47 pm

    Re: php exec('jsexec')
    By: Mortifis to All on Fri Jun 12 2020 11:04 am

    I have a php script that calls exec('/sbbs/exec/jsexec blah blah blah', $result); but it does not return any result ... even exec('/sbbs/exec/jsexec -v', $result); does return a result ... but exec('ls -ln /sbbs/exec/jsexec'); does, as do other system commands ... possible jsexec is doing something to stdout?

    You would to execute a script that writes to stdout (e.g. with "write", "writeln" methods). The status output of jsexec won't be captured by your php script since jsexec knows it's not being run from a console, it redirects status messages to /dev/null.

    digital man
    }



    mytest.js:

    load("sbbsdefs.js");

    function dump_objs(obj) {
    Object.keys(obj).forEach(function (e) {
    writeln( e + ': ' + JSON.stringify(obj[e]));
    });
    }

    if(!argv[0])
    writeln('No argumants ... aborting ');
    else
    dump_objs(argv);

    any ideas?

    Nope, no ideas. I never tried executing jsexec from PHP.

    digital man

    guess writing to a file and reading it back will have to do, I'll play with it and see. Thanks Digital Man, I appreciate the reply.

    ~Mortifis

    ---
    ■ Synchronet ■ Realm of Dispair BBS - http://ephram.synchro.net:82