Rename error in Linux VirtualLeaf tutorial: "Bareword "tutorial0" not allowed while "strict subs" in use at (eval 1) line 1."

I'm going through the VirtualLeaf tutorial, and while it has options for both Windows and MacOSX/Linux, it does not always work for me.

When trying to "rename all the remaining files ..." (step 4 page 339 of Building Simulation Models of Developing Plant Organs Using Virtual Leaf)

I got the following error:

$ rename tutorial0 mymodel *
Bareword "tutorial0" not allowed while "strict subs" in use at (eval 1) line 1.

This is because rename syntax is different for Ubuntu in which it is expecting
$ rename 's/search/replace/;' file1 [file2 file3...]

So, I used the following
$ rename 's/tutorial0/mymodel/;' *

and checked it with
$ ls

to see that it indeed had renamed my files! I found the answer to this here.

Comments

Popular Posts