#!/bin/sh # Search packages by contents COLUMNS=`resize | cut -d\; -f1 | cut -d= -f2` curl -s "https://pkgs.alpinelinux.org/contents?file=$1&arch=${2:-x86}" | awk ' // { print } // { getline; getline; print } ' | sed 's/^ *//; s/<[^>]*>//g; s,/,/,g' | paste - - - - - | column -to ' ' | { test -t 1 && cut -c -$COLUMNS || cat; }