switch to sed version, comment out awk version

This commit is contained in:
2023-07-19 19:45:11 +01:00
parent 9e2724f7d8
commit 0121846aa6

View File

@ -1,6 +1,7 @@
#!/bin/sh #!/bin/sh
# one-liner to list just the names of packages manually-installed with xbps-install, with no version numbers etc # 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: # 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
# xbps-query --list-manual-pkgs | sed "s/-[0-9].*//g" # alternative awk version:
# xbps-query --list-manual-pkgs | awk '{gsub(/-[0-9]+.*$/, ""); print $0}'