Commit a99ceaaec0ad70f7f05b9a6324408f5ebe4560f0
Improve pps alias
* Colorize title line
* Drop useless `-e WCHAN`
* Do not filter out current shell or results of `pps bash` look puzzling
* Avoid child which does `ps -elf` showing up in results
Author: xaizek
Author date (UTC): 2018-04-29 13:53
Committer name: xaizek
Committer date (UTC): 2018-04-29 13:53
Parent(s): 4e3e0848c21f0cd308cc37837ff03cae2255243b
Signing key: 99DC5E4DB05F6BE2
Tree: ee02884efa4f93904b336e080190e7e986ed1445
File |
Lines added |
Lines deleted |
bashrc |
4 |
3 |
File bashrc changed (mode: 100644) (index b28015a..a07b507) |
... |
... |
function pps() |
431 |
431 |
|
|
432 |
432 |
local title= |
local title= |
433 |
433 |
local lines= |
local lines= |
|
434 |
|
local input=$(ps -elf) |
434 |
435 |
while read line; do |
while read line; do |
435 |
436 |
if [ -z "$title" ]; then |
if [ -z "$title" ]; then |
436 |
437 |
title="$line" |
title="$line" |
437 |
438 |
else |
else |
438 |
439 |
lines="$lines$line"$'\n' |
lines="$lines$line"$'\n' |
439 |
440 |
fi |
fi |
440 |
|
done < <(ps -elf) |
|
441 |
|
echo "$title" |
|
442 |
|
echo "$lines" | grep -v $$ | grep -i -e WCHAN -e "$@" |
|
|
441 |
|
done <<< "$input" |
|
442 |
|
echo $'\e[33m'"$title"$'\e[m' |
|
443 |
|
echo "$lines" | grep -i "$@" |
443 |
444 |
} |
} |
444 |
445 |
|
|
445 |
446 |
# connect to remote host via ssh and run/connect to "remote" tmux session there |
# connect to remote host via ssh and run/connect to "remote" tmux session there |