Re: bash quoting problems

2011-08-10 Thread thomas . kral
Hi! I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in the corrct place. Does anyone know how to do this?

Re: bash quoting problems

2011-08-10 Thread Ivan Shmakov
thomas kral thomas.k...@email.cz writes: I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in the

Re: bash quoting problems

2011-08-10 Thread Andreas Berglund
On 2011-08-09 01:51, Bob Proulx wrote: sed -i s|^\( *PATH=\\)\(.*\)|\1$ADD:\2| ~/profile-test The above seems like you are doing more than you need with the long match for (.*) and \2. It isn't needed. It is much more efficient to avoid matching a potentially infinite amount of data.

Re: bash quoting problems

2011-08-10 Thread Andreas Berglund
On 2011-08-10 00:43, Bob McGowan wrote: On 08/08/2011 04:43 PM, Andreas Berglund wrote: Hi! I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the

Re: bash quoting problems

2011-08-10 Thread Andreas Berglund
On 2011-08-10 07:46, Ivan Shmakov wrote: Andreas Berglundandreas.bergl...@home.se writes: I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one

Re: bash quoting problems

2011-08-09 Thread Bob McGowan
On 08/08/2011 04:43 PM, Andreas Berglund wrote: Hi! I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in the

Re: bash quoting problems

2011-08-09 Thread Ivan Shmakov
Andreas Berglund andreas.bergl...@home.se writes: I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in

bash quoting problems

2011-08-08 Thread Andreas Berglund
Hi! I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in the corrct place. Does anyone know how to do this?

Re: bash quoting problems

2011-08-08 Thread Bob Proulx
Andreas Berglund wrote: I have a problem with the following sed snippet sed -i s|^\( *PATH=\)\(.*\)|\1$ADD:\2| ~/profile-test I need soft quotes in order for $ADD to expand and I also need to math against one doublequote in the regexp in for $ADD to be put in the corrct place. Does anyone