little oops on which variable to check for emptiness.
authorChris Koeritz <fred@gruntose.com>
Sat, 10 Mar 2012 15:57:07 +0000 (10:57 -0500)
committerChris Koeritz <fred@gruntose.com>
Sat, 10 Mar 2012 15:57:07 +0000 (10:57 -0500)
scripts/core/functions.sh

index 61e19c4abf32c2cb5d42c444dedcaed3a9a33483..6b741d616aaf32244312140bc6cae03f24fb4842 100644 (file)
@@ -99,11 +99,11 @@ if [ -z "$skip_all" ]; then
   # finds all processes matching the pattern specified and shows their full
   # process listing (whereas psfind just lists process ids).
   function psa() {
-    p=$(psfind "$1")
-    if [ -z "$p" ]; then
+    if [ -z "$1" ]; then
       echo "psa finds processes by pattern, but there was no pattern on the command line."
       return 1
     fi
+    p=$(psfind "$1")
     echo ""
     echo "Processes containing \"$1\"..."
     echo ""