diff options
author | schrmh | 2018-09-18 07:25:52 +0200 |
---|---|---|
committer | schrmh | 2018-09-18 07:25:52 +0200 |
commit | cfcecc5b6868c2d8eb419acdbc666e1cefac18c4 (patch) | |
tree | 7c504a491ebebd80e442694d9430fc7eb4e5ec64 /fakeAUR.sh | |
parent | acd2d662eefaa4eeb50512210e475448467e99e7 (diff) | |
download | aur-cfcecc5b6868c2d8eb419acdbc666e1cefac18c4.tar.gz |
double output fix!
Diffstat (limited to 'fakeAUR.sh')
-rwxr-xr-x | fakeAUR.sh | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/fakeAUR.sh b/fakeAUR.sh index ef972a1cf188..926799b52f9a 100755 --- a/fakeAUR.sh +++ b/fakeAUR.sh @@ -21,7 +21,7 @@ then exit 1 fi -first=1 +first="enabled" for i in "$@" do case $i in @@ -94,18 +94,19 @@ for i in "$@" echo $description ;; *) - if [ "$first" ] then - processes=$(> >(ps -f)) - pac=$(echo $processes | grep -o -P "(?<=00:00:00).*(?=$USER)" | grep -o -P "(?<=00:00:00).*(?=00:00:00)") - helper=$(echo $pac | cut -d' ' -f1) - two=$(echo $pac | cut -d' ' -f2) - pac=$helper" "$two - - description=$(echo -ne '\n' | eval "${pac}" | grep " ") - name=$(echo ${pac} | grep -Eo "[^ ]+$") - echo ${PS1@P}$helper $1 - echo -ne '\n' | eval ${pac} | sed -e "s/$name/$1/" | sed -e "s/$description/$2/" - fi + if [[ $first = "enabled" ]]; then + first="disabled" + processes=$(> >(ps -f)) + pac=$(echo $processes | grep -o -P "(?<=00:00:00).*(?=$USER)" | grep -o -P "(?<=00:00:00).*(?=00:00:00)") + helper=$(echo $pac | cut -d' ' -f1) + two=$(echo $pac | cut -d' ' -f2) + pac=$helper" "$two + + description=$(echo -ne '\n' | eval "${pac}" | grep " ") + name=$(echo ${pac} | grep -Eo "[^ ]+$") + echo ${PS1@P}$helper $1 + echo -ne '\n' | eval ${pac} | sed -e "s/$name/$1/" | sed -e "s/$description/$2/" + fi ;; esac done |