Return code -1 executing command on Linux

2008-03-13
2012-08-14
  • I am seeing odd behavior executing a command string under linux. I have used this for years using Regina Rexx on Solaris, but this construct doesn't appear to work on ooRexx 3.1.1 on Linux. (Haven't had a chance to try 3.2.0 yet).

    The problem seems to be related to the fact that I actually have 2 commands being executed in the same command line, separated by a semicolon. I'm relatively new to Linux, so I'm not sure what the significant difference is here. I am using a similar setup on Linux that I did on Solaris.

    Thanks for any help...

    Steve Johnson

    stevej:1> cat cdexec

    !/usr/cisco/bin/rexx

    Trace ?i

    'cd /users/stevej; ls -l 1'
    stevej:2> cdexec
    +++ "LINUX COMMAND /users/stevej/rexx/cdexec"
    5 - 'cd /users/stevej; ls -l 1'
    >L> "cd /users/stevej; ls -l 1"
    >>> "cd /users/stevej; ls -l 1"
    +++ "RC(-1)"
    +++ Interactive trace. "Trace Off" to end debug, ENTER to Continue. +++

    stevej:3>

     
    • Perry Werneck
      Perry Werneck
      2008-03-13

      Hi,

      It doesn't seem like a rexx problem. What's the result of the same line when typed directly in the console? Is the file/folder "/users/stevej/1" availabe?

       
      • William
        William
        2008-03-19

        -bash-3.2$ rexxtry
        REXX-ooRexx_3.2.0(MT) 6.02 12 Jan 2008
        rexxtry lets you interactively try REXX statements.
        Each string is executed when you hit Enter.
        Enter 'call tell' for a description of the features.
        Go on - try a few... Enter 'exit' to end.
        '(cd;ls)'
        Aint_We_Cute.eml -draw Music
        %backup%~ 'eth0:10.1.1.102 MUW.motd
        bin flouresence_mask.png My_Life
        bunny_1.wav flouresence.mvg nautilus-debug-log.txt
        Desktop flouresence_overlay.png papi-1.0_beta-x86.rpm
        Desktop.base FreshFlower_mask.png Pictures
        Desktop.jpg FreshFlower.mvg Public
        Desktop.mvg FreshFlower_overlay.png Templates
        Documents Log Videos
        Download M WEB
        rc = 0 ............................................ rexxtry on LINUX

        You need to use the single quote to tell rexx to pase this string to linux.
        Then use the '(' and ')' to tell linux this is a complex command.

         
    • Hi... here's the result directly from the command line...

      stevej:101> cd /users/stevej/; ls -l 1
      -rw-r--r-- 1 stevej eng 90547 Feb 29 16:49 1
      stevej:102>

      Could this have something to do with the default shell being used by the rexx interpreter? I use tcsh, what does rexx use?

      Thanks Steve