I'd been trying to use the rename function in my debian, I searched here at unix.stackexchange but it seems the solution is not the same in my scenario which files contains []
[800p]-[WOLU-H]-test1.mkv
[800p]-[WOLU-H]-test2.mkv
desired output is just
[WOLU-H]-test1.mkv
[WOLU-H]-test2.mkv
i tried
rename [800p]-[WOLU-H] [WOLU-H] [800p]-*
but it keeps saying:
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"
I tried other such as
rename 's/[800p]-[WOLU-H]/[WOLU-H]/' [800p]-*
but output also failed
Invalid [] range "U-H" in regex; marked by <-- HERE in m/[800p]-[WOLU-H <-- HERE ]/ at (eval 1) line 1.
can somebody enlighten me with the correct process? Thanks!
UPDATE
I tried this:
rename 's/\[800p\]-\[WOLU-H\]/\[WOLU-H\]/' \[800p\]-*
but error:
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
I also tried this:
rename "[800p]-[WOLU-H]" "[WOLU-H]" "[800p]-"*
But still error
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"
I think the -
with numerics are messing?
[
using\
.