Write a bash shell script called psping which checks periodically if a specific executable has a live process. Following

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Write a bash shell script called psping which checks periodically if a specific executable has a live process. Following

Post by answerhappygod »

Write a bash shell script called psping which checksperiodically if a specific executable has a
live process. Following is the exactsynopsis:
psping [-c ###] [-t ###] [-u user-name]exe-name
Counts and echos number of live processes for a user,whose executable file is exe-name.
Repeats this every second indefinitely, unless passedother specifications using switches:
-c - limit amount of pings, e.g. -c 3. Default isinfinite
-t - define alternative timeout in seconds, e.g. -t 5.Default is 1 sec
-u - define user to check process for. Default is ANYuser.
Following are some examples. All of them are based on asystem that runs the following
Processes:
UID CMD
jack /opt/google/chrome/chrome--type=-broker
jack /opt/google/chrome/chrome--type=zygote
mark /opt/google/chrome/chrome--type=-broker
mark /usr/bin/java my.jar -jar ~/project/chrome--render
root /sbin/init splash
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply