On Thu, May 30, 2013 at 1:01 PM, Les Mikesell wrote:
> On Thu, May 30, 2013 at 11:43 AM, Larry Martell
> wrote:
>
> >>> Because a cat is a terrible thing to waste.
> >>>
> >>
> >> It goes back to the days of expensive computing resources when every
> >> process mattered (the days of wood
Larry Martell wrote:
> On Thu, May 30, 2013 at 9:42 AM, wrote:
>> Larry Martell wrote:
>>> On Thu, May 30, 2013 at 8:37 AM, wrote:
Tilman Schmidt wrote:
> Am 18.05.2013 21:23, schrieb Larry Martell:
>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>
>
On Thu, May 30, 2013 at 11:43 AM, Larry Martell wrote:
>>> Because a cat is a terrible thing to waste.
>>>
>>
>> It goes back to the days of expensive computing resources when every
>> process mattered (the days of wooden computers and iron
>> programmers...).
>
> Exactly - it mattered on
On Thu, May 30, 2013 at 10:30 AM, Les Mikesell wrote:
> On Thu, May 30, 2013 at 10:52 AM, Larry Martell
> wrote:
>>
>>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>>
>> Because a cat is a terrible thing to waste.
>>
>>>
>>> So why cat | sed?
>>
>> I reall
On Thu, May 30, 2013 at 10:52 AM, Larry Martell wrote:
>
>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>
> Because a cat is a terrible thing to waste.
>
>>
>> So why cat | sed?
>
> I really don't see why that is a big deal.
It goes back to the days of expe
On Thu, May 30, 2013 at 9:42 AM, wrote:
> Larry Martell wrote:
>> On Thu, May 30, 2013 at 8:37 AM, wrote:
>>> Tilman Schmidt wrote:
Am 18.05.2013 21:23, schrieb Larry Martell:
> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
http://en.wikipedia.org/wiki/C
Larry Martell wrote:
> On Thu, May 30, 2013 at 8:37 AM, wrote:
>> Tilman Schmidt wrote:
>>> Am 18.05.2013 21:23, schrieb Larry Martell:
cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>>>
>>> http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_cat
>>>
>>> Because a
On Thu, May 30, 2013 at 8:37 AM, wrote:
> Tilman Schmidt wrote:
>> Am 18.05.2013 21:23, schrieb Larry Martell:
>>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>>
>> http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_cat
>>
>> Because a cat is a terrible thing to wa
Tilman Schmidt wrote:
> Am 18.05.2013 21:23, schrieb Larry Martell:
>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>
> http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_cat
>
> Because a cat is a terrible thing to waste.
>
Without even reading the wikipedia piece, I
Am 18.05.2013 21:23, schrieb Larry Martell:
> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
http://en.wikipedia.org/wiki/Cat_%28Unix%29#Useless_use_of_cat
Because a cat is a terrible thing to waste.
SCNR
T.
signature.asc
Description: OpenPGP digital signature
___
Oops, I read that too late ...
> Let's say my original lines are:
> CN=DATA.OU=XYZ.O=CO
> CN=DATA.OU=XYY.OU=MEM.O=CO
> CN=DATA.OU=XZZ.OU=OOP.O=CO
>
> I want them to look like:
> CN=XYZ_DATA.OU=XYZ.O=CO
> CN=XYY_DATA.OU=XYY.OU=MEM.O=CO
> CN=XZZ_DATA.OU=XZZ.OU=OOP.O=CO
then the perl script would
Hi James,
perl -pne 's/^(CN=)(DATA\.OU=)((.*?)\.O=CO)$/$1$4_$2$3/' /file/name
or, if you prefer in-place editing,
perl -i.bak -pne 's/(CN=)(DATA\.OU=)((.*?)\.O=CO)/$1$4_$2$3/' /file/name
which replaces the file with the modified version and keeps a .bak file around
for security.
Exampl
On Sat, May 18, 2013 at 7:31 PM, James Pifer wrote:
>
> Let's say my original lines are:
> CN=DATA.OU=XYZ.O=CO
> CN=DATA.OU=XYY.OU=MEM.O=CO
> CN=DATA.OU=XZZ.OU=OOP.O=CO
>
> I want them to look like:
> CN=XYZ_DATA.OU=XYZ.O=CO
> CN=XYY_DATA.OU=XYY.OU=MEM.O=CO
> CN=XZZ_DATA.OU=XZZ.OU=OOP.O=CO
>
> So
From: John Doe
> From: James Pifer
>> I have a long file that has lines like this:
>> some text
>> some text2
>> CN=DATA.OU=XYZ.O=CO
>> some text3
>> some text4
>>
>> I need to change the middle line but leave the rest of the file as is
>> like this:
>> some text
>> some text2
>> CN
From: James Pifer
> I have a long file that has lines like this:
> some text
> some text2
> CN=DATA.OU=XYZ.O=CO
> some text3
> some text4
>
> I need to change the middle line but leave the rest of the file as is
> like this:
> some text
> some text2
> CN=XYZ_DATA.OU=XYZ.O=CO
> some text3
> some
On 5/19/2013 9:03 AM, Larry Martell wrote:
> On Sat, May 18, 2013 at 6:31 PM, James Pifer wrote:
>> On 5/18/2013 3:23 PM, Larry Martell wrote:
>>> On Sat, May 18, 2013 at 1:15 PM, James Pifer wrote:
Sorry for the off topic, but don't a better resource. I'm not great at
scripting, but ne
On Sat, May 18, 2013 at 6:31 PM, James Pifer wrote:
> On 5/18/2013 3:23 PM, Larry Martell wrote:
>> On Sat, May 18, 2013 at 1:15 PM, James Pifer wrote:
>>> Sorry for the off topic, but don't a better resource. I'm not great at
>>> scripting, but need a quick script to modify a file.
>>>
>>> I hav
Am 19.05.2013 um 02:31 schrieb James Pifer :
> On 5/18/2013 3:23 PM, Larry Martell wrote:
>> On Sat, May 18, 2013 at 1:15 PM, James Pifer wrote:
>>
>> cat file | sed -e's/CN=DATA.OU=\(.*\)\.O=CO/CN=\1_DATA.OU=\1.O=CO/'
>
> Larry,
>
> Thanks for the answer. Still having trouble making it work. B
>
> Thanks for the answer. Still having trouble making it work. Been looking
> at sed for the last two hours. Let me give a specific example of a few
> lines I would want to change:
>
> Let's say my original lines are:
> CN=DATA.OU=XYZ.O=CO
> CN=DATA.OU=XYY.OU=MEM.O=CO
> CN=DATA.OU=XZZ.OU=OOP.O=CO
On 5/18/2013 3:23 PM, Larry Martell wrote:
> On Sat, May 18, 2013 at 1:15 PM, James Pifer wrote:
>> Sorry for the off topic, but don't a better resource. I'm not great at
>> scripting, but need a quick script to modify a file.
>>
>> I have a long file that has lines like this:
>>
>> some text
>> s
On Sat, May 18, 2013 at 1:15 PM, James Pifer wrote:
> Sorry for the off topic, but don't a better resource. I'm not great at
> scripting, but need a quick script to modify a file.
>
> I have a long file that has lines like this:
>
> some text
> some text2
> CN=DATA.OU=XYZ.O=CO
> some text3
> some
Sorry for the off topic, but don't a better resource. I'm not great at
scripting, but need a quick script to modify a file.
I have a long file that has lines like this:
some text
some text2
CN=DATA.OU=XYZ.O=CO
some text3
some text4
And this repeats, but XYZ changes. "DATA" is always called data
22 matches
Mail list logo