ocehb: (Default)
[personal profile] ocehb
В конкретном каталоге перевести все файлы и каталоги (и подкаталоги и т.д.) в нижний регистр.



function convert-depth () {
  local i
  pushd "$1" > /dev/null
  for i in *; do
    [[ "$i" != "${(L)i}" ]] && mv -f "$i" "${(L)i}"
    [[ -d "$i" ]] && convert-depth "${(L)i}"
  done
  popd > /dev/null
}

Date: 2006-07-28 02:58 pm (UTC)
From: [identity profile] ex-svpv.livejournal.com
zmv '(*)' '${(L)1}'
Что-то рекурсивно **/* у меня сходу не заработало.

fts тоже самому делать смысла нет, можно через find
find . |while read -r f; do
[ $f = ${(L)f} ] || mv $f ${(L)f}
done

Хм. Правда с find'ом не работает. Забавно!

Profile

ocehb: (Default)
ocehb

January 2021

S M T W T F S
     12
345 6789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 6th, 2026 07:18 pm
Powered by Dreamwidth Studios