![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| case insensitive on purpose file system 0.1 (Default branch) | iBot | Software Releases - RSS News | 0 | 05-10-2008 03:40 PM |
| case insensitive | ROOZ | Shell Programming and Scripting | 4 | 03-11-2008 09:40 AM |
| how to make case insensitive checks???? | hitmansilentass | Shell Programming and Scripting | 5 | 04-30-2007 11:23 AM |
| Case-insensitive serach with awk | acheepi | Shell Programming and Scripting | 4 | 07-15-2005 02:58 PM |
| case insensitive locate | davis.ml | UNIX for Dummies Questions & Answers | 3 | 11-17-2003 08:14 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
awk case-insensitive
can I tell awk to be case insensitive for one operation without setting the ignorecase value ?
thanks, Steffen |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
You cannot use IGNORECASE to make certain rules case-insensitive and other rules case-sensitive, because there is no way to set IGNORECASE just for the pattern of a particular rule.
To do this, you must use character sets or tolower. However, one thing you can do only with IGNORECASE is turn case-sensitivity on or off dynamically for all the rules at once. |
|
#3
|
|||
|
|||
|
I know I cannot use IGNORECASE for only certain commands, only globally.
I didnt want to IGNORECASE anyway. My problem is that I have to look for a match in a file using awk and the search string is a variable. Since I cannot control if the variable is lower or upper case, I need to have awk search for any lower or uppercase match(es). Steffen |
|
#4
|
|||
|
|||
|
if you are searching for word "goat" use this
/[Gg][Oo][Aa][Tt]/ |
|
#5
|
|||
|
|||
|
I know that, but I have a user input variable as the search string, I cannot alter the variable to [Aa][Bb][Cc].....
Steffen |
|
#6
|
|||
|
|||
|
tolower/toupper
Why not use the functions tolower()/toupper() functions in awk. That might help you.
|
|
#7
|
|||
|
|||
|
I don't know this function, will take a look at it
thanks, Steffen |
|||
| Google The UNIX and Linux Forums |