Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix pstt and use of other switches

  • Loading branch information...
commit aec4858b0a139ee923c609dfa7f13d29f8509dd9 1 parent ae98ada
Adam Spiers authored
Showing with 16 additions and 3 deletions.
  1. +16 −3 bin/pst
View
19 bin/pst
@@ -10,16 +10,29 @@ linux_pstree () {
}
linux_iterate () {
+ opts=( )
+ while [ -n "$1" ]; do
+ case "$1" in
+ -*)
+ opts=( "${opts[@]}" "$1" )
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+ done
+
if [ $# = 0 ]; then
- linux_pstree
+ linux_pstree "${opts[@]}"
elif [ -d "/proc/$1" ]; then
- linux_pstree "$@"
+ linux_pstree "${opts[@]}" "$@"
else
for proc in "$@"; do
echo "Searching for processes containing '$proc' ..."
for pid in `pgrep -f "$proc"`; do
#echo "Tree for pid $pid:"
- linux_pstree "$pid"
+ linux_pstree "${opts[@]}" "$pid"
done
done
fi
Please sign in to comment.
Something went wrong with that request. Please try again.