help with aix script required - Aix

This is a discussion on help with aix script required - Aix ; Hi , Hope you can help . I have posted this on the Pick group without much success. My expertise (such as it is) is in D3 and not AIX . Aix is simply used as the host o/s. The ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: help with aix script required

  1. help with aix script required

    Hi ,

    Hope you can help . I have posted this on the Pick group without much
    success.

    My expertise (such as it is) is in D3 and not AIX . Aix is simply used
    as the host o/s.

    The scenario is as follows :-


    AIX version 5 on RS6000
    D3 (PICK) release 7.4.1.RS


    Remote login using MPSL and Accuterm telnet.


    The user-coldstart includes TRAP DCD EXIT and the account logon proc
    includes DCD-ON.


    Users login with individual aix profiles which include a d3 -n -dcdon
    command.Where 'n' is the port number for the individual login in the
    range 1-300. It appears that despite the above users are not always
    logged off completely with the result that the next login results in
    the error message

    ERROR: PIB nnn is already connected ( pid nnnnn)

    A subsequent kill nnnnn clears the problem but this option is not
    available to the remote users.

    Can anyone help with an aix script to examine the aix response , and
    if it the above error, to extract the pid and then execute kill (pid
    nnnn)
    before retrying the d3 -n -dcdon command.

    Or is there a better solution?


    Best Regards


    Dave


  2. Re: help with aix script required

    On Sep 7, 10:34 am, david_humphr...@btconnect.com wrote:
    > Hi ,
    >
    > Hope you can help . I have posted this on the Pick group without much
    > success.
    >
    > My expertise (such as it is) is in D3 and not AIX . Aix is simply used
    > as the host o/s.
    >
    > The scenario is as follows :-
    >
    > AIX version 5 on RS6000
    > D3 (PICK) release 7.4.1.RS


    There's a flashback. It's been a good 20 years since I've seen
    anything with PICK was a DB at college running on either PRIMOS or
    maybe on the IBM 360/370 mainframe.

    > [...]


    > ERROR: PIB nnn is already connected ( pid nnnnn)
    >
    > A subsequent kill nnnnn clears the problem but this option is not
    > available to the remote users.
    >
    > Can anyone help with an aix script to examine the aix response , and
    > if it the above error, to extract the pid and then execute kill (pid
    > nnnn)
    > before retrying the d3 -n -dcdon command.


    If it's guaranteed that the above error message is always in exactly
    that format, you could make use of 'cut' to extract the pid. I'm sure
    there's more than one way to do it but I hacked this one up, using
    stdin (typing control-d after pasting the error string), to just echo
    it back as a test.

    $ echo kill `cut -f 9 -d ' ' | cut -f 1 -d ')'`
    ERROR: PIB nnn is already connected ( pid 12345)
    kill 12345
    $

    It looks odd that there'd be a space before 'pid' but that could just
    be the way the code decided to print it out. It's been known to
    happen Depending upon whether it's formatted exactly as above or
    not, you may need to adjust the field #s, e.g. if there's no space
    before pid, the first 'cut' becomes '-f 8'

    I guess you could use something like 'read' to acquire the message
    into a variable. Then look for "ERROR: PIB nnn is already connected"
    and if found, feed the string to the above without the 'echo'.

    It's far from a complete script, but it's a start.

    > Or is there a better solution?


    Sorry I don't know anything about PICK but the optimal solution would
    be to solve the root cause of the problem.

    > Best Regards
    >
    > Dave


    HTH,

    Jon


  3. Re: help with aix script required

    On 8 Sep, 14:37, Jon wrote:
    > On Sep 7, 10:34 am, david_humphr...@btconnect.com wrote:
    >
    > > Hi ,

    >
    > > Hope you can help . I have posted this on the Pick group without much
    > > success.

    >
    > > My expertise (such as it is) is in D3 and not AIX . Aix is simply used
    > > as the host o/s.

    >
    > > The scenario is as follows :-

    >
    > > AIX version 5 on RS6000
    > > D3 (PICK) release 7.4.1.RS

    >
    > There's a flashback. It's been a good 20 years since I've seen
    > anything with PICK was a DB at college running on either PRIMOS or
    > maybe on the IBM 360/370 mainframe.
    >
    > > [...]
    > > ERROR: PIB nnn is already connected ( pid nnnnn)

    >
    > > A subsequent kill nnnnn clears the problem but this option is not
    > > available to the remote users.

    >
    > > Can anyone help with an aix script to examine the aix response , and
    > > if it the above error, to extract the pid and then execute kill (pid
    > > nnnn)
    > > before retrying the d3 -n -dcdon command.

    >
    > If it's guaranteed that the above error message is always in exactly
    > that format, you could make use of 'cut' to extract the pid. I'm sure
    > there's more than one way to do it but I hacked this one up, using
    > stdin (typing control-d after pasting the error string), to just echo
    > it back as a test.
    >
    > $ echo kill `cut -f 9 -d ' ' | cut -f 1 -d ')'`
    > ERROR: PIB nnn is already connected ( pid 12345)
    > kill 12345
    > $
    >
    > It looks odd that there'd be a space before 'pid' but that could just
    > be the way the code decided to print it out. It's been known to
    > happen Depending upon whether it's formatted exactly as above or
    > not, you may need to adjust the field #s, e.g. if there's no space
    > before pid, the first 'cut' becomes '-f 8'
    >
    > I guess you could use something like 'read' to acquire the message
    > into a variable. Then look for "ERROR: PIB nnn is already connected"
    > and if found, feed the string to the above without the 'echo'.
    >
    > It's far from a complete script, but it's a start.
    >
    > > Or is there a better solution?

    >
    > Sorry I don't know anything about PICK but the optimal solution would
    > be to solve the root cause of the problem.
    >
    > > Best Regards

    >
    > > Dave

    >
    > HTH,
    >
    > Jon


    Jon ,

    Thanks for your help . Yes it does look as though 'cut' will take a
    string and separate the data based on a delimiter - in this case space
    and then ')' - which will enable me to extract the pid to pass to a
    kill . However I also need to be able to capture the output of the
    initial input to pass to the cut command . You mention a 'read'
    command - could you please give me more info.

    Best Regards

    dave


  4. Re: help with aix script required

    On Sep 11, 2:28 am, david_humphr...@btconnect.com wrote:
    > On 8 Sep, 14:37, Jon wrote:
    >
    >
    >
    > > On Sep 7, 10:34 am, david_humphr...@btconnect.com wrote:

    >
    > > > Hi ,

    >
    > > > Hope you can help . I have posted this on the Pick group without much
    > > > success.

    >
    > > > My expertise (such as it is) is in D3 and not AIX . Aix is simply used
    > > > as the host o/s.

    >
    > > > The scenario is as follows :-

    >
    > > > AIX version 5 on RS6000
    > > > D3 (PICK) release 7.4.1.RS

    >
    > > There's a flashback. It's been a good 20 years since I've seen
    > > anything with PICK was a DB at college running on either PRIMOS or
    > > maybe on the IBM 360/370 mainframe.

    >
    > > > [...]
    > > > ERROR: PIB nnn is already connected ( pid nnnnn)

    >
    > > > A subsequent kill nnnnn clears the problem but this option is not
    > > > available to the remote users.

    >
    > > > Can anyone help with an aix script to examine the aix response , and
    > > > if it the above error, to extract the pid and then execute kill (pid
    > > > nnnn)
    > > > before retrying the d3 -n -dcdon command.

    >
    > > If it's guaranteed that the above error message is always in exactly
    > > that format, you could make use of 'cut' to extract the pid. I'm sure
    > > there's more than one way to do it but I hacked this one up, using
    > > stdin (typing control-d after pasting the error string), to just echo
    > > it back as a test.

    >
    > > $ echo kill `cut -f 9 -d ' ' | cut -f 1 -d ')'`
    > > ERROR: PIB nnn is already connected ( pid 12345)
    > > kill 12345
    > > $

    >
    > > It looks odd that there'd be a space before 'pid' but that could just
    > > be the way the code decided to print it out. It's been known to
    > > happen Depending upon whether it's formatted exactly as above or
    > > not, you may need to adjust the field #s, e.g. if there's no space
    > > before pid, the first 'cut' becomes '-f 8'

    >
    > > I guess you could use something like 'read' to acquire the message
    > > into a variable. Then look for "ERROR: PIB nnn is already connected"
    > > and if found, feed the string to the above without the 'echo'.

    >
    > > It's far from a complete script, but it's a start.

    >
    > > > Or is there a better solution?

    >
    > > Sorry I don't know anything about PICK but the optimal solution would
    > > be to solve the root cause of the problem.

    >
    > > > Best Regards

    >
    > > > Dave

    >
    > > HTH,

    >
    > > Jon

    >
    > Jon ,
    >
    > Thanks for your help . Yes it does look as though 'cut' will take a
    > string and separate the data based on a delimiter - in this case space
    > and then ')' - which will enable me to extract the pid to pass to a
    > kill . However I also need to be able to capture the output of the
    > initial input to pass to the cut command . You mention a 'read'
    > command - could you please give me more info.
    >
    > Best Regards
    >
    > dave


    awk is your friend, "cut" is for beginners


  5. Re: help with aix script required

    > awk is your friend, "cut" is for beginners

    horses for courses .. cut is more lightweight than awk and perl is far
    more versatile than awk .. so, if its something simple, then cut is
    the obvious choice .. awk certainly has its place in the middle and
    perl for the more complex stuff.

    Rgds
    Mark Taylor


  6. Re: help with aix script required

    On Sep 12, 12:08 am, Mark Taylor wrote:
    > > awk is your friend, "cut" is for beginners

    >
    > horses for courses .. cut is more lightweight than awk and perl is far
    > more versatile than awk .. so, if its something simple, then cut is
    > the obvious choice .. awk certainly has its place in the middle and
    > perl for the more complex stuff.
    >
    > Rgds
    > Mark Taylor


    awk once cut twice :P


+ Reply to Thread