scripts

Random scripts
git clone git://git.margiolis.net/scripts.git
Log | Files | Refs | README | LICENSE

commit 178b0ab86c835a0fed9e347f4bb3a6ff51dcbc6a
parent 26f03ba79f0dfaa4d4f99974860f7764de6110a4
Author: Christos Margiolis <christos@margiolis.net>
Date:   Wed, 11 Jan 2023 18:59:03 +0200

minor fixes

Diffstat:
MMakefile | 1-
Mausplit | 12++++--------
Dnamefmt | 6------
Mtag | 19+++++++------------
Mupd | 2--
5 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/Makefile b/Makefile @@ -11,7 +11,6 @@ TARGS = ausplit \ fontupd \ irssi_torconf \ mntdroid \ - namefmt \ passget \ push \ rssread \ diff --git a/ausplit b/ausplit @@ -11,13 +11,14 @@ main() # The extension must exist in `tag`. ext="${1#*.}" - xread "Album/book title: " album - xread "Artist/author: " author - xread "Publication year: " year + read -erp "Album/book title: " album + read -erp "Artist/author: " author + read -erp "Publication year: " year namefmt="$(fmt_name "${album}")" mkdir -p "${namefmt}" || exit 1 + # FIXME while read -r line; do end="$(echo "${line}" | cut -d' ' -f1)" test -n "${start}" && split_file @@ -36,11 +37,6 @@ usage() echo "usage: ${0##*/} audio timecode_file" 1>&2 && exit 1 } -xread() -{ - printf "%s" "${1}" && read -r ${2} -} - fmt_name() { echo "${1}" | iconv -cf UTF-8 -t ASCII//TRANSLIT | diff --git a/namefmt b/namefmt @@ -1,6 +0,0 @@ -#!/bin/sh - -# FIXME: give path/s from command line -for file in $(find .); do - mv ${file} $(echo ${file} | tr '-' '_') -done diff --git a/tag b/tag @@ -8,11 +8,6 @@ usage() exit 1 } -xread() -{ - printf "%s" "${1}" && read -r ${2} -} - while getopts "a:t:A:n:N:d:g:c:f:" arg; do case "${arg}" in a) artist="${OPTARG}" ;; @@ -32,13 +27,13 @@ shift $((OPTIND - 1)) file="${1}" test ! -f "${file}" && echo "${0##*/}: file not found" && usage -test -z "${title}" && xread "Title: " title -test -z "${artist}" && xread "Artist: " artist -test -z "${album}" && xread "Album: " album -test -z "${track}" && xread "Track number: " track -test -z "${total}" && xread "Total tracks in album: " total -test -z "${date}" && xread "Date: " date -test -z "${genre}" && xread "Genre: " genre +test -z "${title}" && read -erp "Title: " title +test -z "${artist}" && read -erp "Artist: " artist +test -z "${album}" && read -erp "Album: " album +test -z "${track}" && read -erp "Track number: " track +test -z "${total}" && read -erp "Total tracks in album: " total +test -z "${date}" && read -erp "Date: " date +test -z "${genre}" && read -erp "Genre: " genre temp="$(mktemp)" cp -f "${file}" "${temp}" diff --git a/upd b/upd @@ -1,6 +1,5 @@ #!/bin/sh -# FIXME: trim random symbols case $1 in www) src="${HOME}/src/margiolis.net/public/" dst="master@margiolis.net:/var/www/htdocs/margiolis.net" @@ -22,6 +21,5 @@ esac test -z "${src}" && echo "${0##*/}: src is empty" 1>&2 && exit 1 test -z "${dst}" && echo "${0##*/}: dest is empty" 1>&2 && exit 1 -# add directory error check read -erp "${0##*/}: transfer '${src}' to '${dst}' (y/N)? " act test "${act}" = "y" && rsync -Purv --delete-after "${src}" "${dst}"