Eu estava tentando usar a função rename no meu debian, eu procurei aqui no unix.stackexchange mas parece que a solução não é a mesma no meu cenário quais arquivos contém []
[800p]-[WOLU-H]-test1.mkv
[800p]-[WOLU-H]-test2.mkv
a saída desejada é apenas
[WOLU-H]-test1.mkv
[WOLU-H]-test2.mkv
eu tentei
rename [800p]-[WOLU-H] [WOLU-H] [800p]-*
mas continua dizendo:
Bareword found where operator expected at (eval 1) line 1, near "800p"
(Missing operator before p?)
syntax error at (eval 1) line 1, near "800p"
Eu tentei outros, como
rename 's/[800p]-[WOLU-H]/[WOLU-H]/' [800p]-*
mas a saída também falhou
Invalid [] range "U-H" in regex; marked by <-- HERE in m/[800p]-[WOLU-H <-- HERE ]/ at (eval 1) line 1.
alguém pode me esclarecer com o processo correto? Obrigado!
UPDATE
Eu tentei isso:
rename 's/\[800p\]-\[WOLU-H\]/\[WOLU-H\]/' \[800p\]-*
mas erro:
Bareword found where operator expected at (eval 1) line 1, near "800p"
(Missing operator before p?)
Backslash found where operator expected at (eval 1) line 1, near "p\"
Backslash found where operator expected at (eval 1) line 1, near "]\"
(Missing operator before \?)
Backslash found where operator expected at (eval 1) line 1, near "]\"
(Missing operator before \?)
syntax error at (eval 1) line 1, near "800p"
Unmatched right square bracket at (eval 1) line 1, at end of line
Unmatched right square bracket at (eval 1) line 1, at end of line
Eu também tentei isso:
rename "[800p]-[WOLU-H]" "[WOLU-H]" "[800p]-"*
Mas ainda erro
Bareword found where operator expected at (eval 1) line 1, near "800p"
(Missing operator before p?)
syntax error at (eval 1) line 1, near "800p"
Eu acho que o -
com numerics está bagunçando?