Last active
January 11, 2022 11:52
-
-
Save kou1okada/86936964ed8c80d7b33b7ddb9a3ef8df to your computer and use it in GitHub Desktop.
lspkgs.sh - List Packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# lspkgs.sh - List Packages | |
# Copyright 2019 (c) Koichi OKADA. All rights reserved. | |
# This script is distributed under the MIT license. | |
# | |
function help () | |
{ | |
cat <<-EOD | |
Usage: ${0##*/} {cygwin|msys2} | |
EOD | |
} | |
function cygwin () | |
{ | |
wget -qO- https://cygwin.com/packages/package_list.html \ | |
| grep -E '^<tr><td><a href="' \ | |
| sed -E 's:.*href="([^"]*)".*:\1:g' | |
} | |
function msys2 () | |
{ | |
wget -qO- https://packages.msys2.org/base \ | |
| grep -EA1 '<tr>' \ | |
| grep -E '<td><a href="' \ | |
| sed -E 's/.*"([^"]+)".*/\1/g' | |
} | |
"${@:-help}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment