aboutsummaryrefslogtreecommitdiff
path: root/unix/hlib/spy.cl
diff options
context:
space:
mode:
authorJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
committerJoe Hunkeler <jhunkeler@gmail.com>2015-08-11 16:51:37 -0400
commit40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch)
tree4464880c571602d54f6ae114729bf62a89518057 /unix/hlib/spy.cl
downloadiraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'unix/hlib/spy.cl')
-rw-r--r--unix/hlib/spy.cl31
1 files changed, 31 insertions, 0 deletions
diff --git a/unix/hlib/spy.cl b/unix/hlib/spy.cl
new file mode 100644
index 00000000..31522f4d
--- /dev/null
+++ b/unix/hlib/spy.cl
@@ -0,0 +1,31 @@
+# SPY -- [MACHDEP] Give info on who is logged in, what they are up to,
+# how much resources they have consumed, and so on. This routine is
+# machine dependent.
+
+procedure spy()
+
+begin
+ string mach
+
+ if ($nargs > 0) {
+ # "Verbose" mode: show UNIX processor status, filtering
+ # out all the uninteresting system processes.
+
+ print ("!!uname" | cl() | scan (mach)
+ if (strlwr (mach) == "ssol") {
+ !! ps -ef | grep -v root
+ } else if (strlwr (mach) == "SunOS") {
+ !! ps -axu | grep -v root
+ } else if (strlwr (mach) == "linux" || strlwr (mach) == "Darwin") {
+ !! ps axuf | grep -v root
+ } else {
+ !! ps -ef | grep -v root
+ }
+
+ } else {
+ # Merely give info on who is logged in and what they are doing.
+ # The following is for Berkeley UNIX only.
+
+ !! w
+ }
+end