summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2023-03-27 20:21:26 -0700
committerXiao Pan <gky44px1999@gmail.com>2023-03-27 20:21:26 -0700
commit4957916f8de9320bc29a13eaa4f324dade742082 (patch)
tree7c2bb638dce73dd92d8bfac11af9d6c42f0af787 /home
parent37abed7fd6201a8054158713f50fffe75eee4037 (diff)
awk better style
Diffstat (limited to 'home')
-rwxr-xr-xhome/xyz/.local/bin/mrt3
-rwxr-xr-xhome/xyz/.local/bin/pq2
2 files changed, 3 insertions, 2 deletions
diff --git a/home/xyz/.local/bin/mrt b/home/xyz/.local/bin/mrt
index dc6435f2..883ab8f0 100755
--- a/home/xyz/.local/bin/mrt
+++ b/home/xyz/.local/bin/mrt
@@ -27,7 +27,8 @@ mullvad relay update
# https://stackoverflow.com/a/17988834/9008720
for relay in $(mullvad relay list | awk -v location="$location" '
$0 ~ location {f=1;next}
-/^\t[[:alpha:]]/ {f=0} f {
+/^\t[[:alpha:]]/ {f=0}
+f {
if($5 == "WireGuard,")
print $1
}'); do
diff --git a/home/xyz/.local/bin/pq b/home/xyz/.local/bin/pq
index 85b2b365..d5f2fa29 100755
--- a/home/xyz/.local/bin/pq
+++ b/home/xyz/.local/bin/pq
@@ -2,7 +2,7 @@
# Pacman Query, to manually determine remove the package or not
[ "$1" ] && {
- pacman -Qi "$1" | awk '/^Depends On/{f=1}/^Conflicts With/{f=0}f || /^Description/ || /^URL/ || /^Groups/ || /^Installed Size/ || /^Install Reason/'
+ pacman -Qi "$1" | awk '/^Depends On/{f=1} /^Conflicts With/{f=0} f || /^Description/ || /^URL/ || /^Groups/ || /^Installed Size/ || /^Install Reason/'
printf '\n'
pacman -Ql "$1" | grep '/bin/[^$]'
printf '\n'