how to tell if "rename" in your distro supports regular expressions
I am trying to do a rename using a regular expression, and it doesn't seem to work.
I did a web scan, and it looks like some versions of linux don't support regular expressions for commands. How do I tell if a version of linux supports regular expressions? for that matter, how do I tell what version of linux I am using? |
Quote:
Code:
uname -r |
I get:
2.6.18-194.26.1.el5 how do I tell if that version of linux supports regular expressions in the commands? |
Hi lynne007,
could you please explain what you want to do? I don't understand your question. Linux is the kernel. There are many programs/commands which support regular expressions. But the kernel and the programs are different things. Markus |
Quote:
We could provide better information if you described your problem in greater detail. What exactly are you trying to do? Here is an example of a good question: Quote:
|
sorry about not giving more detail.
I was trying to do this: rename -v 's/\.ccp/\.cpp/' /home/xxx/*.ccp and this: rename -v 's/????e0\.cpp/????\.cpp/' /home/xxx/*.cpp I read this: http://tips.webdesign10.com/how-to-b...n-the-terminal with this caveat: Quote:
I finally ended up with this - which worked.. but was more limited - didn't tell me what was renamed, and it doesn't seem to recognize any regular expression in the find/replace string: rename .ccp .cpp /home/xxx/*.ccp rename e0.cpp .cpp /home/xxx/*.cpp |
Hi,
I'm happy to read that you found a solution. You may as well read more about the shell (bash), for example here: http://tldp.org/LDP/abs/html/ With a little bash-scripting you can do more advanced renaming on the commandline. Markus |
OP - I think you should have looked further down the link you gave us :)
Towards the bottom is the following line: Quote:
somewhere. Then you have the same rename you are trying to invoke :) |
All times are GMT -5. The time now is 09:14 AM. |