bin: various corrections

This commit is contained in:
xeruf 2022-01-31 10:36:25 +01:00
parent 8af2f94cbe
commit 57ad5f2e1b
4 changed files with 6 additions and 4 deletions

View File

@ -32,7 +32,7 @@ fileinfo() {
$elevate file -E "$arg" $elevate file -E "$arg"
#probe="$($elevate ffprobe "$arg" 2>&1)" #probe="$($elevate ffprobe "$arg" 2>&1)"
#echo $probe | grep -v -e '00:00:00.04' -e 'ansi' && #echo $probe | grep -v -e '00:00:00.04' -e 'ansi' &&
$elevate ffprobe "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' || $elevate ffprobe -hide_banner "$arg" 2>&1 | grep "bitrate: ....\? " | sed 's/, start:[^,]\+,/,/' ||
stat --format "%A %s $( stat --format "%A %s $(
size="$($elevate unzip -l "$arg" 2>/dev/null | tail -1)" && size="$($elevate unzip -l "$arg" 2>/dev/null | tail -1)" &&
echo "(uncompressed $(echo $size | cut -d' ' -f1 | numfmt --to=iec-i --suffix=B))" echo "(uncompressed $(echo $size | cut -d' ' -f1 | numfmt --to=iec-i --suffix=B))"

View File

@ -1,7 +1,7 @@
#!/bin/sh -e #!/bin/sh -e
# Displays the latest files in the given directory or pwd # Displays the latest files in the given directory or pwd
test "$1" = "-a" && all=true && shift test "$1" = "-a" && all=true && shift
for f in "${@:-PWD}" for f in "${@:-$PWD}"
do test $# -gt 1 && highlight "$f" do test $# -gt 1 && highlight "$f"
find "$f" -maxdepth 4 -type f -printf '%.16T+ %P\n' | find "$f" -maxdepth 4 -type f -printf '%.16T+ %P\n' |
sort -r | $(test "$all" && echo "less" || echo "head") sort -r | $(test "$all" && echo "less" || echo "head")

View File

@ -13,7 +13,9 @@ then
fi fi
if grep -e "^LABEL=$arg[^\w/]" /etc/fstab if grep -e "^LABEL=$arg[^\w/]" /etc/fstab
then mount -L "$@"; exit $? then # have to mount twice as the first one might be creating the directory
mount -L "$@" 2>/dev/null || mount -L "$@"
exit $?
fi fi
if grep -e "[^\w=/]$arg[^\w/]" /etc/fstab if grep -e "[^\w=/]$arg[^\w/]" /etc/fstab
then mount "$@"; exit $? then mount "$@"; exit $?

View File

@ -35,7 +35,7 @@ then shift
done done
else else
test "$1" = "-q" && quiet=-q && shift test "$1" = "-q" && quiet=-q && shift
test -n "$(mpc playlist)" && next=-q test -n "$(mpc playlist)" -a "$(mpc status | wc -l)" -gt 1 && next=-q
test "$1" = "--seek" && seek=-q test "$1" = "--seek" && seek=-q
( "$0" -r "$@" && mpc -q update --wait ) | #tee /tmp/mp 2>&1 ( "$0" -r "$@" && mpc -q update --wait ) | #tee /tmp/mp 2>&1
xargs --delim='\n' mpc insert xargs --delim='\n' mpc insert