cleaned up bashisms

This commit is contained in:
Luxferre
2026-07-27 20:33:44 +03:00
parent 3c952b7631
commit 9775b3edc4
9 changed files with 46 additions and 46 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ f2p() {
printf '%b' "$cprefix" # always start with the prefix
IFS='' # separator
while read -r -s -d '' -n1 b; do # convert every byte
if [ "$c" == "$l" ]; then # roll over and output suffix+prefix
if [ "$c" = "$l" ]; then # roll over and output suffix+prefix
c=0 # reinit counter
printf '%b' "$csuffix" # end the chunk
printf '%b' "$cprefix" # begin a new chunk
@@ -36,13 +36,13 @@ f2p() {
}
# main code
LF=$'\n' # cache the linefeed character
LF="$(printf '\n')" # cache the linefeed character
flist='' # pre-build the file list from args
dlist='' # pre-build the directory list from args
for i; do # iterate over args
bname="${i##*/}" # get the basename
if [ -d "$i" ]; then # it's a directory, we skip . and ..
[ "$bname" == '.' ] || [ "$bname" == '..' ] && continue
[ "$bname" = '.' ] || [ "$bname" = '..' ] && continue
dlist="${dlist}${i%/}${LF}" # append the directory
else # it's a file
dname="${i%%$bname}" # get the basedir