X-Git-Url: https://iankelling.org/git/?p=small-misc-bash;a=blobdiff_plain;f=psg-function;h=bdef3516a46d5f7bf3cdf34f41d5cc33f397b974;hp=ccdd12aff199341b56c2c0d2c90cc99745122049;hb=HEAD;hpb=d45fc11e96ef63e654f12a7ca91a8ce2c0145cb8 diff --git a/psg-function b/psg-function deleted file mode 100644 index ccdd12a..0000000 --- a/psg-function +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash -# Copyright (C) 2016 Ian Kelling - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -psg () { - local x y help - help="Usage: psg [--help] GREP_ARGS -grep ps and output in a nice format" - if [[ $1 == --help ]]; then - echo "$help" - return - fi - x=$(sudo ps -eF) - # final grep is because some commands tend to have a lot of trailing spaces - y=$(echo "$x" | grep -P "$@" | grep -o '.*[^ ]') - if [[ $y ]]; then - echo "$x" | head -n 1 - echo "$y" - fi -}