I'm trying to to execute a script, which uses the command rename.
When I execute it, I get a message rename: command not found. Any ideas?
if [[ -z '$3' ]]; then shopt -s dotglob rename "$EXPRESSION" ./*
else rename "$EXPRESSION" "$3"
fi 2 2 Answers
I just had to install the rename package.
sudo apt install rename 7 My Ubuntu has a man page for rename(1) on fresh install, but running rename gives a CNF error.
The man page style suggests that the command belongs to GNU Core Utilities, but confusingly it actually is rename.ul (Ubuntu Bionic / Disco / Eoan + Debian Buster). This command corresponds to the mysterious rename(1) page.
If you install rename package, the new man page is rename(1p). It's a Perl script, not coreutils.