Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14
I put an echo message in and noticed that TMOUT is not getting set correctly. + TMOUT=1800 + readonly TMOUT + export TMOUT + /usr/bin/id -u + [[ 775 -eq ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    178

    I put an echo message in and noticed that TMOUT is not getting set correctly.

    + TMOUT=1800
    + readonly TMOUT
    + export TMOUT
    + /usr/bin/id -u
    + [[ 775 -eq 755 ]]


    $ echo $TMOUT
    + echo 1800
    1800

  2. #12
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    178
    I did try
    export TMOUT="" and
    TMOUT=0

    same results.

    Looks like its skipping the code all together.

    I tried this line also but get an error
    I tried TMOUT="" and " " and 0 nothing works

    if $LOGNAME=oracle; then
    export TMOUT=
    fi


    -----------------

    output
    + TMOUT=1800
    + readonly TMOUT
    + export TMOUT
    + '[oracle=oracle]'
    /etc/profile[79]: [oracle=oracle]: not found [No such file or directory]
    Last edited by unix1adm; 02-05-2014 at 05:26 PM.

  3. #13
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    178
    OK i found my typo doh!!!!!!
    New day new eyes... I was so focused on the condition i never looked at the for line and the valid uid.

    for each in 775; do
    echo $each
    if [[ $(/usr/bin/id -u) -eq $each ]]; then
    TMOUT=""
    export TMOUT=""
    echo $TMOUT
    fi
    done


    I had 755 not 775...

    However I still get this error even though it is set in /etc/profile

    + su - oracle
    + TMOUT=1800
    + readonly TMOUT
    + export TMOUT
    + echo 775
    775
    + /usr/bin/id -u
    + [[ 775 -eq 775 ]]
    /etc/profile: line 82: TMOUT: is read only
    $ echo $TMOUT
    + echo 1800
    1800

  4. #14
    Linux Newbie
    Join Date
    Oct 2008
    Posts
    178
    Ok so this is what I ended up with.

    I moved the readonly line to after the for loop.

    TMOUT=1800
    export TMOUT

    for each in 775; do
    if [[ $(/usr/bin/id -u) -eq $each ]]; then
    TMOUT=""
    export TMOUT=""
    fi
    done
    readonly TMOUT

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •