skgit() {
local f
for f in $(i s | awk '$1 == "modified:" {print $2}'); do
- if [[ $(head -n1 "$f") == '#!/bin/bash'* ]]; then
+ if istext "$f" && [[ $(head -n1 "$f" 2>/dev/null) == '#!/bin/bash'* ]]; then
sk $f ||:
fi
done
# ls count. usage: pass a directory, get the number of files.
# https://unix.stackexchange.com/questions/90106/whats-the-most-resource-efficient-way-to-count-how-many-files-are-in-a-director
lsc() {
- # shellcheck disable=SC2790 # intentional
+ # shellcheck disable=SC2790 disable=SC2012 # intentional
ls -Uq "$@"|wc -l
}