projects
/
feisty_meow.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9b4fb7d
)
added ability to pass -u USERNAME to psfind.
author
Chris Koeritz
<fred@gruntose.com>
Wed, 24 Jun 2015 20:27:44 +0000
(16:27 -0400)
committer
Chris Koeritz
<fred@gruntose.com>
Wed, 24 Jun 2015 20:27:44 +0000
(16:27 -0400)
scripts/core/functions.sh
patch
|
blob
|
history
diff --git
a/scripts/core/functions.sh
b/scripts/core/functions.sh
index eee56fe36c4156e3c8bf6c65aa090bdac4aa5efe..69a5a78f7ea75841307b41ebfb8041a8ce40fa0f 100644
(file)
--- a/
scripts/core/functions.sh
+++ b/
scripts/core/functions.sh
@@
-110,9
+110,19
@@
if [ -z "$skip_all" ]; then
#echo ====
#echo patterns list is: "${patterns[@]}"
#echo ====
#echo ====
#echo patterns list is: "${patterns[@]}"
#echo ====
+
+ local user_flag
+ if [ "${patterns[0]}" == "-u" ]; then
+ user_flag="-u ${patterns[1]}"
+echo "found a -u parm and user=${patterns[1]}"
+ # void the two elements with that user flag so we don't use them as patterns.
+ unset patterns[0] patterns[1]=
+ fi
+
local PID_DUMP="$(mktemp "$TMP/zz_pidlist.XXXXXX")"
local -a PIDS_SOUGHT
if [ "$OS" == "Windows_NT" ]; then
local PID_DUMP="$(mktemp "$TMP/zz_pidlist.XXXXXX")"
local -a PIDS_SOUGHT
if [ "$OS" == "Windows_NT" ]; then
+#hmmm: windows isn't implementing the user flag yet!
# windows case has some odd gyrations to get the user list.
if [ ! -d c:/tmp ]; then
mkdir c:/tmp
# windows case has some odd gyrations to get the user list.
if [ ! -d c:/tmp ]; then
mkdir c:/tmp
@@
-140,7
+150,7
@@
if [ -z "$skip_all" ]; then
| sed -n -e "$appropriate_pattern"))
done
else
| sed -n -e "$appropriate_pattern"))
done
else
- /bin/ps $
extra_flags
wuax >$PID_DUMP
+ /bin/ps $
user_flag
wuax >$PID_DUMP
#echo ====
#echo got all this stuff in the pid dump file:
#cat $PID_DUMP
#echo ====
#echo got all this stuff in the pid dump file:
#cat $PID_DUMP
@@
-205,10
+215,9
@@
if [ -z "$skip_all" ]; then
extra_flags=
if [ "$OS" = "Windows_NT" ]; then
# special case for windows.
extra_flags=
if [ "$OS" = "Windows_NT" ]; then
# special case for windows.
- extra_flags=-W
ps | head -1
for curr in $p; do
ps | head -1
for curr in $p; do
- ps
$extra_flags
| grep "$curr"
+ ps
-W
| grep "$curr"
done
else
# normal OSes can handle a nice simple query.
done
else
# normal OSes can handle a nice simple query.