AIX

 View Only
  • 1.  /dev/tcp broken in KSH{,93} on AIX7.3

    Posted Thu February 02, 2023 02:38 PM
    Hi,

    the /dev/tcp/... pseudo devices are missing in ksh and ksh93 on AIX7.3

    $ < /dev/tcp/localhost/22
    ksh93: /dev/tcp/localhost/22: cannot open [A file or directory in the path name does not exist.]
    $ oslevel -s
    7300-00-02-2220
    $ print ${.sh.version}
    Version M 93u+ 2012-08-01

    In bash it works as expected

    $ bash -c -- '< /dev/tcp/localhost/22'
    $ echo $?
    0

    This is, to be polite, unacceptable! Why is ksh treated so poorly?!

    Best regards,
    P. Tanovski

    ------------------------------
    Plamen Tanovski
    ------------------------------


  • 2.  RE: /dev/tcp broken in KSH{,93} on AIX7.3

    Posted Thu February 02, 2023 03:09 PM
    Works for me in ksh93 on AIX 7.2, but not ksh (ksh89).

    cat < /dev/tcp/localhost/21
    220 localhost FTP server (Version 4.2 Mon Jan 27 07:54:52 CST 2020) ready.

    Otherwise remember KSH(89) and KSH93 aren't bash.

    On Thu, Feb 02, 2023 at 07:37:50PM +0000, Plamen Tanovski via IBM Community wrote:
    > Hi,
    >
    > the /dev/tcp/... pseudo devices are missing in ksh and ksh93 on AIX7.3
    >
    > $ < /dev/tcp/localhost/22
    > ksh93: /dev/tcp/localhost/22: cannot open [A file or directory in the path name does not exist.]
    > $ oslevel -s
    > 7300-00-02-2220
    > $ print ${.sh.version}
    > Version M 93u+ 2012-08-01
    >
    > In bash it works as expected
    >
    > $ bash -c -- '< /dev/tcp/localhost/22'
    > $ echo $?
    > 0
    >
    > This is, to be polite, unacceptable! Why is ksh treated so poorly?!
    >
    > Best regards,
    > P. Tanovski
    >
    > ------------------------------
    > Plamen Tanovski
    > ------------------------------
    >
    >
    > Reply to Sender : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6049&MID=354446&SenderKey=52e236d8-428c-4433-b802-231ce1569745
    >
    > Reply to Discussion : https://community.ibm.com/community/user/eGroups/PostReply?GroupId=6049&MID=354446
    >
    >
    >
    > You are subscribed to "AIX" as Russell.Adams@AdamsSystems.nl. To change your subscriptions, go to http://community.ibm.com/community/user/preferences?section=Subscriptions. To unsubscribe from this community discussion, go to http://community.ibm.com/HigherLogic/eGroups/Unsubscribe.aspx?UserKey=c23dfccc-9910-40ae-beeb-fdcbced5bf1f&sKey=KeyRemoved&GroupKey=7b554d78-d4dc-417a-b4dc-017e309e5c91.


    ------------------------------------------------------------------
    Russell Adams Russell.Adams@AdamsSystems.nl
    Principal Consultant Adams Systems Consultancy
    https://adamssystems.nl/




  • 3.  RE: /dev/tcp broken in KSH{,93} on AIX7.3

    Posted Thu February 02, 2023 03:39 PM
    Hi,

    yes, ksh89 doesn't support it, but the /dev/tcp pseudo devices for ksh93 are described in the reference Korn/Bolsky's "The new Kornshell", first on page 54, on the original man page, also in the book Learning the Kornshell, 2nd. ed.

    Besides, as you noted, it worked on AIX7.2, why break it in the next version? Instead, they could finally make process substitution work on AIX.

    Best regards

    ------------------------------
    Plamen Tanovski
    ------------------------------