your sed expression doesn't work. here is the corrected one. btw, this might not be a good solution to do the substitution. e.g.
(.T[A-Z]*Game\) what happens, if after "T", there is another "T"? anyway, here is the info you want:
If this sed implementation honors locales and if the locale is set to one of the English utf8 locales, the highlighted range expression will be more promiscuous than intended. The reason why is that these utf8 locales interleave the alphabet so that the collation order specified by A-Z also includes all but one of the lowercase letters.
The [a-zA-Z] construct, under those utf8 locales, will cover the entire English alphabet but will include all but 2 letters twice. Fortunately, this still gives the same result as when each letter is included only once.
If the desired match is the uppercase alphabet in the current locale's language (whatever that may be), then the [:upper:] character class should be used.
If only the uppercase English alphabet is to be matched, the script can use [:upper:] with any of the English language locales or it can use [:upper:] or [A-Z] with the C/POSIX locale. In either case, if English only is to be matched, the script should explicitly specify the locale to protect itself against future changes in its invoking environment's locale.
All range expressions (even [0-9]) are technically undefined outside of the POSIX locale. Do not use them unless the C/POSIX locale is in effect. This may seem like a pointless nit, but a few times over the past couple of years I've diagnosed range expressions outside of the C/POSIX locale as the cause of failure in scripts that had worked fine for over a decade. Take my word for it and be kind to your future self, for this bug manifests itself intermittently and, to someone not familiar with how the locale affects the collating sequence, in an unfathomable way.
I have a file whose output words are always like this:
aaaa
bbbb
cccc
dddd. Trying to arrange the data so that there are 2 columns such that the 1st word become the 1st column like this:
aaaa aaaa
aaaa bbbb
aaaa cccc
aaaa dddd Trying to use awk... (8 Replies)
How can we empty or replace with null, following block of code (within the php quotes including the quotes) from inside a file.
*** some other data above this code
<?
#317008#
... (5 Replies)
Hi,
i have a file as give below
>cat sample_file
param1 val1 2012-06-19
##there can be one or more space after 2012-06-19 in the above file
i want to replace val1 with a with value passed through a variable...
below is the command i tried
>parval='param1 val2'
>par1=param1
>sed... (3 Replies)
Hello,
I have a comman separated file lets day data.txt in following format
,:000002 CH XIN9I.INDX, 34.7534909645,:000002 CH,:Index XIN9I.INDX
,:000063 CH XIN9I.INDX, 6.3062924781,:000063 CH,:Index XIN9I.INDX
,:000776 CH XIN9I.INDX, 2.7001954832,:000776 CH,:Index XIN9I.INDX
I would like... (9 Replies)
I'm trying to change a "." in a file name with a "_"
I have tried;
sed -e 's/./_/g'
However this then replaces the entire filename with a load of "_"
For example;
ls /usr/local/feed/service/customers/test1/configs/test1.httpsend | awk -F/ '{print $9}' | tr "" "" | sed -e "s/./_/g"
... (2 Replies)
Hi,
i am following content in file
cat file
Install Installation-path variable
Now i need to replace Installation-path with some text to be provided as argument in csh script invocation
My question is , can i replace this by only using path
eg.
sed "s/path/$1" file
but it... (1 Reply)
my script:
amount1=`tail /tmp/file1.txt`
amount2=`tail /tmp/file2.txt`
sed -e 's/'${amount2}'/'${amount1}'/g' filename1 > filename2
what did i do wrong ? i just want to replace amount1 with amount2 value. (2 Replies)
Okay, title is kind of confusion, but basically, I have a lot of scripts on a server that I need to replace a ps command, however, the new ps command I'm trying to replace the current one with pipes to sed at one point. So now I am attempting to create another script that replaces that line.
... (1 Reply)
Hi,
I want to change a particular string in a file with another string. This is part of a larger script file. I m using SED for this purpose:
sed -e 's/hostname.domainname/${HOST}.${DOMAIN}/g' $sed_file>$tmp_file
Where the occurance hostname.domainname has to be replaced with the... (4 Replies)