Very simple script doesn't work in aix 4.1.4.0 - no idea why - Aix

This is a discussion on Very simple script doesn't work in aix 4.1.4.0 - no idea why - Aix ; Hello, I am trying to run a very simple part of a larger script on aix 4.3 - oslevel gives me actually 4.1.4.0. As this part of the script is absolutely individual, I will paste you only it: ######################################### if ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Very simple script doesn't work in aix 4.1.4.0 - no idea why

  1. Very simple script doesn't work in aix 4.1.4.0 - no idea why

    Hello,

    I am trying to run a very simple part of a larger script on aix 4.3 -
    oslevel gives me actually 4.1.4.0. As this part of the script is
    absolutely individual, I will paste you only it:
    #########################################
    if [[ `lsuser -a rlogin root | cut -d= -f2` = "false" && `lsuser -a
    login root | cut -d= -f2` = "true" ]]
    then
    echo "\tOK: Root user can't login directly remotely, but can login on
    the local console"
    elif [[ `lsuser -a rlogin root | cut -d= -f2` = "false" && `lsuser -a
    login root | cut -d= -f2` = "false" ]]
    then
    echo "\tOK: Root user can't login neither remotely, nor locally on
    the console"
    elif [[ `lsuser -a rlogin root | cut -d= -f2` = "true" ]]
    then
    echo "\tProblem: root user can login remotely"
    fi
    ################################################## ########
    If the root user has rlogin=true and login=true - the script creates
    no output... I tried rewriting it using the case statement:
    ################################################## ###########
    case `lsuser -a rlogin root | cut -d= -f2` in
    "true")
    echo "\tProblem: root user can login remotely"
    ;;
    "false")
    if [[ `lsuser -a login root | cut -d= -f2` = "true" ]]
    then
    echo "\tOK: Root user can't login directly remotely, but can login
    on the local console"
    else
    echo "\tOK: Root user can't login neither remotely, nor locally on
    the console"
    fi
    ;;
    esac
    #################################################
    And still no output... I tried the separate output of the lsuser | cut
    commands - it is true/false, as expected. Does anybody have an idea
    why this simple thing is not working? Thanks a lot in advance.

    P.S. I tried both of the scripts in 5.2, they work with no problem...


  2. Re: Very simple script doesn't work in aix 4.1.4.0 - no idea why

    On Feb 19, 10:30 am, "Simeon.Iskidzhiyski" wrote:
    > Hello,
    >
    > I am trying to run a very simple part of a larger script on aix 4.3 -
    > oslevel gives me actually 4.1.4.0. As this part of the script is
    > absolutely individual, I will paste you only it:
    > #########################################
    > if [[ `lsuser -a rlogin root | cut -d= -f2` = "false" && `lsuser -a
    > login root | cut -d= -f2` = "true" ]]
    > then
    > echo "\tOK: Root user can't login directly remotely, but can login on
    > the local console"
    > elif [[ `lsuser -a rlogin root | cut -d= -f2` = "false" && `lsuser -a
    > login root | cut -d= -f2` = "false" ]]
    > then
    > echo "\tOK: Root user can't login neither remotely, nor locally on
    > the console"
    > elif [[ `lsuser -a rlogin root | cut -d= -f2` = "true" ]]
    > then
    > echo "\tProblem: root user can login remotely"
    > fi
    > ################################################## ########
    > If the root user has rlogin=true and login=true - the script creates
    > no output... I tried rewriting it using the case statement:
    > ################################################## ###########
    > case `lsuser -a rlogin root | cut -d= -f2` in
    > "true")
    > echo "\tProblem: root user can login remotely"
    > ;;
    > "false")
    > if [[ `lsuser -a login root | cut -d= -f2` = "true" ]]
    > then
    > echo "\tOK: Root user can't login directly remotely, but can login
    > on the local console"
    > else
    > echo "\tOK: Root user can't login neither remotely, nor locally on
    > the console"
    > fi
    > ;;
    > esac
    > #################################################
    > And still no output... I tried the separate output of the lsuser | cut
    > commands - it is true/false, as expected. Does anybody have an idea
    > why this simple thing is not working? Thanks a lot in advance.
    >
    > P.S. I tried both of the scripts in 5.2, they work with no problem...


    apparently somewhere along the line, the output of these commands
    dropped a trailing space.
    try: "true " and "false "



  3. Re: Very simple script doesn't work in aix 4.1.4.0 - no idea why

    Thanks a lot! The problem appeared to be exactly that... I deleted it
    with tr and now everything is fine. Thanks again


+ Reply to Thread