
February 5th, 2004, 06:58 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Posts: 65
Time spent in forums: 3 h 36 m 31 sec
Reputation Power: 0
|
|
|
need help with csh script
I am writing a script which is to search for some strings in a text file. When you execute the script like this "scriptname <argument>" it will output all the lines in the text file with the substring of the argument for example scriptname Bob will output all lines with Bob in them. I can do this easily enough with awk. The problem is, if you type scriptname bob, it will only match bob but not Bob. Unfortunately there is no way to ignore case with awk. How can I get around this? It is safe to assume that in the text file the substrings I search for will always start with a capital and be followed by lower case letters. So if there is a way to convert only the first letter of the argument to a capital, that would solve my problem. For example if the user types "scriptname bob" or "scriptname BOB" it should convert the argument bob or BOB to Bob. Is there a way I can convert only the first letter of the argument to a capital and convert the rest of the letters of that argument to lower case?
|