|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
can anybody tell me a command to get sed command which ignores case.
example is like this I want to search a file for the pattern "shameem" and this should replace the occurence of "SHAMEEM" also with "shammu". cat file1 | sed "s/shameem/shammu/" > file1 so if the file1 consists of "shameem gouse lazam SHAMEEM" then this command should give the output as "shammu gouse lazam shammu" please help me in this reg... Thank you Shameem S |
|
#2
|
|||
|
|||
|
$ echo "SoMe TeXt"| sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz'/
some text But this is a more elegant solution (nt using sed): $ echo "SoMe TeXt" | tr '[A-Z]' '[a-z]' some text |
|
#3
|
|||
|
|||
|
I am sorry this wont work. because it changes whole text. I dont want to change the remaining text other than matching pattern.
for e.g. shameem GOUSE Lazam I want to change this as shammu GOUSE Lazam but not shammu gouse lazam I want to replace shameem with shammu. Nothing else. Thank you for your reply. Its a good solution for conversion from uppercase to lower case or vice versa. if you have any idea about my issue let me know... |
|
#4
|
|||
|
|||
|
I misunderstood.
Ok, new try: $ SAMPLE="ShAmeEm GOUSE Lazam" $ echo $SAMPLE ShAmeEm GOUSE Lazam $ echo $SAMPLE | sed 's/shameem/Shammu/i' Shammu GOUSE Lazam $ SAMPLE="SHAMEEM GOUSE Lazam" $ echo $SAMPLE SHAMEEM GOUSE Lazam $ echo $SAMPLE | sed 's/shameem/Shammu/i' Shammu GOUSE Lazam Whatever the upper/lowercase combo of the searchstring (shameem) it will be replaced by Shammu. BTW: What does 'Shameem/Shammu GOUSE Lazam'' mean?? |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > ignoring case in sed command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|