From 0121846aa6c6218cf17190da107fb43b34d73587 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 19 Jul 2023 19:45:11 +0100 Subject: [PATCH] switch to sed version, comment out awk version --- list_manual_pkgs.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/list_manual_pkgs.sh b/list_manual_pkgs.sh index f3d687c..3ed3552 100644 --- a/list_manual_pkgs.sh +++ b/list_manual_pkgs.sh @@ -1,6 +1,7 @@ #!/bin/sh # one-liner to list just the names of packages manually-installed with xbps-install, with no version numbers etc -xbps-query --list-manual-pkgs | awk '{gsub(/-[0-9]+.*$/, ""); print $0}' +xbps-query --list-manual-pkgs | sed "s/-[0-9].*//g" -# alternative sed version: -# xbps-query --list-manual-pkgs | sed "s/-[0-9].*//g" +# i originally wrote this using awk, but i realised that sed would allow for a more elegant implementation, although there was no meaningful speed difference during my tests +# alternative awk version: +# xbps-query --list-manual-pkgs | awk '{gsub(/-[0-9]+.*$/, ""); print $0}'