hello All. I am working on something that should be really simply.
It turns out that its not. I am trying to produce output to list the hostname along with all the current running programs.
the script im using is:
for PS in `ps -Ao "user,args" | cut -d' ' -f1,2`
do
echo "`uname -n`, $PS"
done
The desired output would look something like this:
This line is only for portability (define HOST if not yet defined); you can omit it on Linux/bash.
Likewise ps -eo is supposed to work everywhere, while ps -Ao is Linux-only.
---------- Post updated at 03:14 PM ---------- Previous update was at 01:24 PM ----------
Just seeing that Solaris also has ps -Ao .
Seems even be demanded by Posix.