# torn - Musical files renaming with russian language transliteration
-# Copyright (C) 2007-2023 Sergey Matveev (stargrave@stargrave.org)
+# Copyright (C) 2021-2023 Sergey Matveev (stargrave@stargrave.org)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
local rusL=( ж ч ш щ я ю Ж Ч Ш Щ Я Ю)
local engL=(zh ch sh sch ja ju Zh Ch Sh Sch Ja Ju)
for i ({1..${#rusL}}) eval n=\${n:gs/${rusL[$i]}/${engL[$i]}}
- print $n
+ print -- $n
}
tornm() {
n=${n:gs/&/and}
[[ $n =~ "\." ]] && n=${n:r}.${(L)n:e}
[[ $n =~ "^([[:digit:]]+)[-.]_*(.+)$" ]] && n="$match[1].$match[2]"
- print $n
+ print -- $n
}
local n=${1:t}
n=`tornm $n`
n=`tornt $n`
-print ${1:h}/$n
+print -- ${1:h}/$n