I am using bash on Lubuntu 20.04 LTS, but I get an error using the rename command.

Asked 2 years ago, Updated 2 years ago, 325 views

symptoms
Installed the rename command with apt-get on the Lubuntu 20.04 LTS bash.Then, when I ran the following command so that the file extension is .sh and the extension is .txt, I got an error.

$rename.sh.txt*.sh
syntax error at (user-supplied code), near ".""

Also, when I tried running without ., I got a message from Bareword~.

$renamesh txt*sh
Bareword "sh" not allowed while" strict subs" in use at (user-supplied code).

Expectations
I would like to convert all extensions of .sh files to .txt.

Reproduction Steps

$sudo apt-get install rename
$ rename.sh.txt*.sh
$ $rename sh txt*sh

ubuntu bash

2022-09-30 21:51

1 Answers

rename's/\.sh$/.txt/'*.sh

I think you can convert it in


2022-09-30 21:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.