$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv
| # CephFS pool/layout migration tool ("transcoder") | |
| # | |
| # Loosely inspired by: | |
| # https://git.sr.ht/~pjjw/cephfs-layout-tool/tree/master/item/cephfs_layout_tool/migrate_pools.py | |
| # https://gist.github.com/ervwalter/5ff6632c930c27a1eb6b07c986d7439b | |
| # | |
| # MIT license (https://opensource.org/license/mit) | |
| import os, stat, time, signal, shutil, logging, sys | |
| from concurrent.futures import ThreadPoolExecutor |
| #!/usr/bin/env python3 | |
| # vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python | |
| # This file is part of Supermicro IPMI certificate updater. | |
| # Supermicro IPMI certificate updater is free software: you can | |
| # redistribute it and/or modify it under the terms of the GNU General Public | |
| # License as published by the Free Software Foundation, version 2. | |
| # | |
| # This program is distributed in the hope that it will be useful, but WITHOUT |
$ zmv -n '(.)(<->)(.[^.]#)' '$1$(($2+1))$3' # would rename x.0001.y to x.2.y. $ zmv -n '(.0#)(<->)(.[^.]#)' '$1$(($2+1))$3'
$ zmv '*' '${(L)f}'
$ autoload zmv