3 ms·
This is cool. There is already a command called rename[1] that can do some of this but this is much more interactive (and probably more intuitive for vi users).
by blueblob 13y ago
This is cool. There is already a command called rename[1] that can do some of this but this is much more interactive (and probably more intuitive for vi users). Is this scriptable?
[1] http://linux.die.net/man/1/rename http://linux.die.net/man/1/rename
- laurent123456 13y agoThanks, actually I've started developing massren after having tried `rename`, after I realized I had no idea what flavor of regex and syntax I was supposed to be using :) The advantage of using one's own text editor is that it's always familiar. Currently, the command is not really scriptable, but I'd be open to any suggestion.
- blueblob 13y agoI think the syntax is pcrepattern[1] though I may very well be wrong. I definitely agree to the strength being that you know your editor. I suppose scripting would be hard to do without knowing the editor. I artificially applied vim as the editor because that was what you used in the example. I very recently found vimcat[2] from another thread and thought that something similar could be done with this. I guess it may not be much more effective than just using sed and a for loop in <insert shell here> though. [1] http://linux.die.net/man/3/pcrepattern http://linux.die.net/man/3/pcrepattern [2] http://www.vim.org/scripts/script.php?script_id=4325 http://www.vim.org/scripts/script.php?script_id=4325