Mercurial > ec-dotfiles
view bin/moeauto @ 692:a04ba615362c
[bashrc] back to prioritizing gnuls for openbsd
It should be fixed by now...? Can't remember what the problem was though.
author | nanaya <me@nanaya.pro> |
---|---|
date | Sun, 23 Oct 2022 01:56:26 +0900 |
parents | 5bafb912837e |
children |
line wrap: on
line source
#!/bin/sh if [ "$#" -lt 1 ]; then cat <<EOF Usage: $(basename -- "$0") EOF exit 1 fi if [ ! -r "$*" ] || [ -d "$*" ]; then cat <<EOF File "$*" can't be read! EOF exit 1 fi SERVER= while read LINE; do if [ -n "$(printf "%s" "${LINE}" | grep "^SERVER=")" ]; then SERVER=$(printf "%s" "${LINE}" | sed -e 's/SERVER=//') else [ -n "${SERVER}" ] && [ ! -z "$(printf "%s" "${LINE}" | grep -v "^$")" ] && moefetch fetch -s "${SERVER}" ${LINE} fi done < "$*"