How To
Summary
Some common UNIX/Linux commands like "ping" return "command not found" error when executed from IBM i shells like QSH and PASE.
Objective
To provide "ping" functionality when using IBM i PASE and QSH shells
Steps
The ping command is part of an operating system's TCP/IP stack. On the IBM i platform, the ping utility is provided by OS/400.
To execute ping from an IBM i POSIX shell, you can use the system utility to call out to the OS/400 command line. For example:
myUser@MyIBMi:~$ system ping localhost
TCP3203: Verifying connection to host system LOOPBACK at address 127.0.0.1.
TCP3215: PING reply 1 from 127.0.0.1 took 0 ms. 256 bytes. TTL 64.
TCP3215: PING reply 2 from 127.0.0.1 took 0 ms. 256 bytes. TTL 64.
TCP3215: PING reply 3 from 127.0.0.1 took 0 ms. 256 bytes. TTL 64.
TCP3215: PING reply 4 from 127.0.0.1 took 0 ms. 256 bytes. TTL 64.
TCP3215: PING reply 5 from 127.0.0.1 took 0 ms. 256 bytes. TTL 64.
TCP3211: Round-trip (in milliseconds) min/avg/max = 0/0/0.
TCP3210: Connection verification statistics: 5 of 5 successful (100 %).
myUser@MyIBMi:~$
IP addresses require single quotation marks within double quotation marks:
system "ping '192.168.1.1'"
Document Location
Worldwide
[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHQAA2","label":"Qshell"}],"ARM Case Number":"TS004148681","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Version(s)"}]
Was this topic helpful?
Document Information
Modified date:
14 June 2022
UID
ibm16334781