Check your PATH environment variable.
If the directory where 'netstat' resides is not in your PATH, then you'll get "command not found". There's nothing about BASH or ZSH which would preclude 'netstat' or 'onetstat' from working.

One of the [un]fortunate things about the myriad command shells available is that most have their own unique way of profiling. (Though most *can* follow the original rules.) That is, if you have $HOME/.bash_profile, and BASH is your login shell, it will get sourced when you log-on rather than $HOME/.profile. You very possibly have different profiling for BASH, ZSH, and stock /bin/sh. As a rule, I either remove $HOME/.bash_profile or make it a sym-link to $HOME/.profile.

I do use ZSH, but less often, so am less familiar with how it works on this point.

ORIGINALLY, /etc/profile gets sourced when you log-on. If you then also have $HOME/.profile, it gets sourced afterward (so you can override system profiling with your own customizations).

A related thing is "RC files", like $HOME/.bashrc. The "RC files" get sourced *every* time a shell is spawned, not just when you log-on. Many newcomers to Unix/Linux/POSIX don't know the difference between the profiles and the RC files, so they throw all of the profiling into (e.g.) $HOME/.bashrc. It's kinda counter-productive. The RC files are for settings which cannot be "inherited" for one reason or another.

It gets worse with graphical logon. (But need not! Just that nobody bothered to set things right for the graphical logon logic.)

Keep it simple and stick with the standards. Avoid shiny things and feechers which cause konfoozhun.

-- R; <><


On 2/16/24 15:48, Michael Babcock wrote:
According to the man page for netstat, it’s a synonym for onetstat.
Issuing netstat in bash 5.2 says command not found.   It may be a moot
point if it’s truly a synonym.

On Fri, Feb 16, 2024 at 2:33 PM Frank Swarbrick <[email protected]>
wrote:

Here's a bit of an off the wall question/request.

Do both 'netstat' and 'onetstat' work in zsh?

In bash, only 'onetstat' works.  I think that bash under z/OS is unable to
follow executables with the 'e' file type (external link).


ls -FalTHp /bin/netstat /bin/onetstat

                     erwxrwxrwx         1 BPXROOT  OMVSGRP        8 Jun  1
2021 /bin/netstat -> ONETSTAT

                     lrwxrwxrwx         1 BPXROOT  OMVSGRP       29 Jun  1
2021 /bin/onetstat -> ../usr/lpp/tcpip/bin/onetstat

Frank

________________________________
From: IBM Mainframe Discussion List <[email protected]> on behalf
of Ed Jaffe <[email protected]>
Sent: Friday, February 16, 2024 12:48 PM
To: [email protected] <[email protected]>
Subject: Re: zsh for z/OS

On 2/16/2024 11:33 AM, Frank Swarbrick wrote:
z/OS 3.1 added the Z Shell, zsh.  Is anyone using it?  How do you like
it.  What interesting features does it have over bash?
I'm only at 2.5, so can't use it.
I am using it. After all, what self-respecting z/OS advocate doesn't
want to use a shell called Z?

I'm not a power user. Not doing anything I couldn't also do in bash...

--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://www.phoenixsoftware.com/



--------------------------------------------------------------------------------
This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system
into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to