Quote:
Originally posted by pepintheshort
Optimus,
I appreciate the insight, but I think you're missing my point. My problem is with the regular expression I posted above. I need help matching the metacharacters.
If you had read my initial post, you'll also see that I am hesitant to use mv or cp to rename the files because (without the "for" loop) it will only mv one file at a time. Since I am a relative newcomer to creating a shell script, I need more information than just one brief phrase - details are extremely critical. So, if you think I should use a "for" loop, why not post a sample of the code - all of the code, not "do cool stuff here" - so that it helps fix my problem. Other new people might read this post too and possibly learn from it.
If you don't know the answer to my question, I would appreciate you not wasting my time, and letting someone else answer - even if its to point me to an FAQ where this type of question may have already been answered. (I did search the BBS briefly before posting and did not match what I was looking for.)
snip.. My files have the names "projectaa", "projectab", "projectac", etc. What I want to do is add the extension ".txt" to each file.../snip
These forums are to help you think of the answer. Not to do the work for you. WE DO NOT FIX YOUR PROBLEMS. WE HELP YOU FIX YOUR PROBLEMS. we are here to help you help yourself and in doing so you become a better coder/admin/hobbiest/l33t d00d
The concept of a forloop it to continue the loop for the # of arugments it is passed.
I am very capable of supplying this answer. I am chooseing to not supply the full answer but instead challenge you to come up with it on your own with some supportive outside assistance.
your sed command is completely unneeded for this request.
If you wrote the sed command why dont you explane to me exactly what you are doing with it.
if all you wanted to know was how to escape metachar then why didnt you just say that to begin with.
To escape metachar use a backslash.
also note in your orig post you did not say you are hesitent to use the move or copy command.
i gave you the framework. you need to work a bit harder at completeing the missing puzzle pieces instead of comming here to complane about not getting what you want when you wanted it.