On Friday, December 6, 2019 6:06:10 PM CET, songbird wrote:
result=`echo "summary: \"\"" | sed -e "s/^summary: .*$/summary:
\"${old_summary}\"/"`
of course this doesn't work. since you use '/' (slash) as delimiter in the
sed expression, the slash in $old_summary is interpreted as the
On Vi, 06 dec 19, 14:50:51, Greg Wooledge wrote:
> On Fri, Dec 06, 2019 at 02:40:49PM -0500, songbird wrote:
> > Greg Wooledge wrote:
> > ...
> > > Ideally, you'd just stop trying to use sed with user-supplied variables
> > > injected into the code. Sed was never built to be safe for that kind of
On Vi, 06 dec 19, 14:40:49, songbird wrote:
>
> the point of doing something in bash is to do it quick and
> see if the concept is useful enough. if enough people decide
> to use it then it can be more formalized.
We often build prototypes / proof-of-concept / experiments that live
much
On Sat, 7 Dec 2019, at 14:20, songbird wrote:
> The Wanderer wrote:
>
> ... about various characters and then @ in particular ...
>
> > As far as I can see, at least on my keyboard, that pretty much just
> > leaves @. It does still sometimes occur in paths and filenames, so it's
> > not really
On Sat 07 Dec 2019 at 09:27:59 (-0500), rhkra...@gmail.com wrote:
> On Saturday, December 07, 2019 07:20:35 AM The Wanderer wrote:
> > Yep - using '/' is only a standard convention, it's not required. When
> > writing an s-expression which I know will be passed a path, I generally
> > use '@'
Andrei POPESCU wrote:
...
pre processing for that one character using a different delimiter
and then processing the results of that with the original delimiter
seems to cover everything i'm worried about. :)
> One trick to avoid this problems is to use a different delimiter, e.g. '|'.
>
>
The Wanderer wrote:
... about various characters and then @ in particular ...
> As far as I can see, at least on my keyboard, that pretty much just
> leaves @. It does still sometimes occur in paths and filenames, so it's
> not really ideal, but it's probably less common there than any of the
>
On Saturday, December 07, 2019 07:20:35 AM The Wanderer wrote:
> Yep - using '/' is only a standard convention, it's not required. When
> writing an s-expression which I know will be passed a path, I generally
> use '@' myself; that A: is conveniently typable on the keyboard, B: is a
>
On 2019-12-07 at 04:43, Andrei POPESCU wrote:
> On Vi, 06 dec 19, 16:15:51, songbird wrote:
>
>> The Wanderer wrote:
>>>
>>> For example, 's/hello/newstring/' would be a valid sed
>>> 's'-expression, but 's/a/b/newstring/' would not; the former
>>> contains three instances of the delimiting
On Vi, 06 dec 19, 16:15:51, songbird wrote:
> The Wanderer wrote:
> >
> > For example, 's/hello/newstring/' would be a valid sed 's'-expression,
> > but 's/a/b/newstring/' would not; the former contains three instances of
> > the delimiting token, which is valid, but the former contains four,
> >
Erik Christiansen wrote:
...
> If the sed implementation of variable regexes proves problematic, then
> there's awk with its Dynamic Regexps. (Section 2.8 of the pdf manual
> floating about out there.)
>
> With its C-like syntax, it's less write-only than perl, perhaps because
> it is of the same
On 06.12.19 14:40, songbird wrote:
> Greg Wooledge wrote:
> ...
> > Ideally, you'd just stop trying to use sed with user-supplied variables
> > injected into the code. Sed was never built to be safe for that kind of
> > work.
>
> sed was designed to operate on streams. a sequence of
>
Greg Wooledge wrote:
...
> If you insist on doing #1, so be it. It's your damned computer, and your
> damned problem. I can only warn you and be ignored so many times
> before I give up and let your fuck yourself, as you so vehemently and
> stubbornly eager to do.
i appreciate the actual
The Wanderer wrote:
>songbird wrote:
...
>> sed was designed to operate on streams. a sequence of characters is
>> a stream. i don't see any reason why putting the variable into the
>> middle of that expression means anything different.
>
> Because sed doesn't see the variable; the variable is
On 2019-12-06 at 14:40, songbird wrote:
> Greg Wooledge wrote: ...
>> Ideally, you'd just stop trying to use sed with user-supplied
>> variables injected into the code. Sed was never built to be safe
>> for that kind of work.
>
> sed was designed to operate on streams. a sequence of characters
On Fri, Dec 06, 2019 at 02:40:49PM -0500, songbird wrote:
> Greg Wooledge wrote:
> ...
> > Ideally, you'd just stop trying to use sed with user-supplied variables
> > injected into the code. Sed was never built to be safe for that kind of
> > work.
>
> sed was designed to operate on streams.
Greg Wooledge wrote:
...
> Ideally, you'd just stop trying to use sed with user-supplied variables
> injected into the code. Sed was never built to be safe for that kind of
> work.
sed was designed to operate on streams. a sequence of
characters is a stream. i don't see any reason why
On Fri, Dec 06, 2019 at 12:06:10PM -0500, songbird wrote:
> #this doesn't work...
> old_summary=`echo "Previous glitches and inconsistencies were due to a
> missing / at the end of the baseurl...
hi,
please reply to the list only...
here is my script fragment:
=
#!/bin/bash
#this doesn't work...
echo -e "\n\nThis doesn't work.\n\n"
old_summary=`echo "Previous glitches and inconsistencies were due to a missing
/ at the end of the baseurl...
Hi all,
I need to do a pattern match with sed of ( and ). I need to replace
every ( with ( and every ) with ) on every line.
Can someone help me with this?
Thanks
Ralph
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
On Fri, 04 Jun 2004 10:31:07 -0400
Ralph Crongeyer [EMAIL PROTECTED] wrote:
Hi all,
I need to do a pattern match with sed of ( and ). I need to replace
every ( with ( and every ) with ) on every line.
Can someone help me with this?
Thanks
Ralph
sed 's/[()]//g'
Here is the test I
Carlos Hanson wrote:
On Fri, 04 Jun 2004 10:31:07 -0400
Ralph Crongeyer [EMAIL PROTECTED] wrote:
Hi all,
I need to do a pattern match with sed of "(" and ")". I need to replace
every ( with "(" and every ) with ")" on every line.
Can someone help me with this?
Thanks
Ralph
On Fri, 04 Jun 2004 11:28:50 -0400
Ralph Crongeyer [EMAIL PROTECTED] wrote:
Carlos Hanson wrote:
On Fri, 04 Jun 2004 10:31:07 -0400
Ralph Crongeyer [EMAIL PROTECTED] wrote:
Hi all,
I need to do a pattern match with sed of ( and ). I need to
replace every ( with ( and every ) with
On Fri, 04 Jun 2004 17:30:28 +0200, Ralph Crongeyer
[EMAIL PROTECTED] wrote:
Carlos Hanson wrote:
On Fri, 04 Jun 2004 10:31:07 -0400
Ralph Crongeyer [EMAIL PROTECTED] wrote:
I need to do a pattern match with sed of ( and ). I need to replace
every ( with ( and every ) with ) on every
thanks Carlos, that works great. I think I am beginning to get grasp regular
expression syntax now.
Thanks very much for you help
John
On Sun, 31 Aug 2003 14:05:38 +0100
Carlos Sousa [EMAIL PROTECTED] wrote:
On Sun, 31 Aug 2003 22:38:58 +1000 John Habermann wrote:
I tried:
cat temp
Hi
I am just beginning to learn how to use sed in order to sort my squid log files by
virtualhost and am having trouble getting my head around how the regular expression
works.
I can sort my log files into the different virtual hosts using grep eg grep '^test'
access-sed.txt
On Sun, 31 Aug 2003 10:20:46 +1000 John Habermann wrote:
I have tried things like the following:
sed -e 's/^w.*\s//' log
thinking that it would delete from the beginning of the line to the
first white space but it deletes all matched expressions.
(man sed, man grep)
It seems you mean
hi ya john
change your /etc/httpd/conf/httpd
Server www.domain-A.com
TransferLog logs/access_log.A
...
Server www.domain-B.com
TransferLog logs/access_log.B
...
Server www.domain-C.com
TransferLog
In article [EMAIL PROTECTED] you wrote:
I tried:
cat temp | sed 's/^[[:alpha:]]*[[:space:]]*//' log
Where temp is:
test.wilderness.org.au/about_us/whatistwsck
203.48.59.163 - - [26/Aug/2003 08:14:01] GET
http://test.wilderness.org.au/about_us/whatistws HTTP/1.0 200 20872 -
On Sun, 2003-08-31 at 07:38, John Habermann wrote:
Hi Carlos
Thanks for your help.
On Sun, 31 Aug 2003 02:10:14 +0100
Carlos Sousa [EMAIL PROTECTED] wrote:
On Sun, 31 Aug 2003 10:20:46 +1000 John Habermann wrote:
I have tried things like the following:
sed -e 's/^w.*\s//'
Hi Carlos
Thanks for your help.
On Sun, 31 Aug 2003 02:10:14 +0100
Carlos Sousa [EMAIL PROTECTED] wrote:
On Sun, 31 Aug 2003 10:20:46 +1000 John Habermann wrote:
I have tried things like the following:
sed -e 's/^w.*\s//' log
thinking that it would delete from the beginning of
On Sun, 31 Aug 2003 22:38:58 +1000 John Habermann wrote:
I tried:
cat temp | sed 's/^[[:alpha:]]*[[:space:]]*//' log
Where temp is:
test.wilderness.org.au/about_us/whatistwsck 203.48.59.163 - -
[26/Aug/2003 08:14:01] GET
http://test.wilderness.org.au/about_us/whatistws HTTP/1.0 200
Hello,
can someone please tell me how to instruct sed to make an empty line
before a certain pattern? For me, the same would be to make a new
line every N lines.
Thank you.
e.g.
NEWLINE
Package: foo
Pin: bar
NEWLINE
Package: ...
etc ...
On Fri, Jan 25, 2002 at 03:13:22PM -0100, andrej hocevar wrote:
Hello,
can someone please tell me how to instruct sed to make an empty line
before a certain pattern? For me, the same would be to make a new
line every N lines.
Thank you.
e.g.
NEWLINE
Package: foo
Pin: bar
NEWLINE
On Wed, Mar 28, 2001 at 10:42:44PM -0600, [EMAIL PROTECTED] wrote:
I need a sed invocation to extract quotes () from around a string.
Basicly `cat /etc/bind/named.conf | grep zone | cut -d | sed $something'
to give me a list of zones I run bind for so I can:
for zone in `$sedcsript`
I need a sed invocation to extract quotes () from around a string.
Basicly `cat /etc/bind/named.conf | grep zone | cut -d | sed $something'
to give me a list of zones I run bind for so I can:
for zone in `$sedcsript`
do
$SOME $zone $MANAGENENT
done
or if there is a
Daniel == Daniel Reuter [EMAIL PROTECTED] writes:
Daniel It should work from command line using bash's multiline
Daniel input capability (with the '). It checks for % at the end
Daniel of lines (hence the $), then reads the next line into the
Daniel buffer and then removes the
Hello Brian,
Check this:
sed '/%$/{
N
s/%\n//
}' yourfile.bib
It should work from command line using bash's multiline input capability
(with the '). It checks for % at the end of lines (hence the $), then
reads the next line into the buffer and then removes the %\n sequence (I
don't quite
I'm trying to write a script and as part of it I need to change the / in a
variable to a . and then put it right back into another variable. I've tried
using sed but can't seem to grip these regular expressions 8-(. Here's what I
got so far:
echo $variable_before | sed s///./ variable_after
On Fri, Nov 03, 2000 at 08:10:48AM -0500, Jesse Goerz wrote:
I'm trying to write a script and as part of it I need to change the / in a
variable to a . and then put it right back into another variable. I've
tried
using sed but can't seem to grip these regular expressions 8-(. Here's what I
Jesse Goerz wrote:
I'm trying to write a script and as part of it I need to change the / in a
variable to a . and then put it right back into another variable. I've
tried
using sed but can't seem to grip these regular expressions 8-(. Here's what I
got so far:
echo $variable_before |
On Fri, 03 Nov 2000, Andrei Pelinescu - Onciul wrote:
Jesse Goerz wrote:
I'm trying to write a script and as part of it I need to change the / in a
variable to a . and then put it right back into another variable. I've
tried
using sed but can't seem to grip these regular expressions
If I have a file with the following format:
a%
ss
j%
ddd
how do I tell sed (or another program) to remove the % and \n
character at the end of each line.
ie. something like
sed 's/%\n//'
but that doesn't work :-(
The reason:
bibtex
On Fri, 3 Nov 2000, Brian May wrote:
bibtex likes to word-wrap/mangle/destroy my long lines (eg. URLs) into
this form:
\bibitem[Mic00]{Microsoft2000}
Microsoft.
\newblock Windows 2000 kerberos authentication.
\newblock White paper, Microsoft, January 2000.
\newblock
Andrew Hately ([EMAIL PROTECTED]) wrote:
Back quotes can't be nested, while $( ) does the same job and can be nested
Actually, you can nest backquotes as long as you \-escape them. $( ) is
great, but if you're ever going to use a traditional Bourne shell, you
won't be able to use it -- so make
On Wed, Oct 20, 1999 at 11:37:26PM -0800,
Ben Lutgens [EMAIL PROTECTED] wrote:
I am writing a shell script using sed I need to figure out how I can store the
output of
grep florida roam.db | sed -e s/^.*\? //g
to a variable. roam.db has entries like, one per line.
value=`grep florida
On Thu, Oct 21, 1999 at 09:53:26AM +0200, Andrew Hately wrote:
What do you want in the variable? Multiple lines?
Did you try
set foo=$( grep florida roam.db | sed -e s/^.*\? //g )
Whats the greater context?
Andrew
I finally got it with
export GREP_RESULT=`grep $LOCATION $HOME/roam.db | sed
On Thu, Oct 21, 1999 at 03:36:01AM -0500, Eric Gillespie, Jr. wrote:
Those are backticks (`), not apostrophes (').
Thanx, figured it out, and man did I feel like a dummy. About 15 minutes
after I sent off the e-mail. Nevermind that I tried everything for an hour or
two and read and read all
Hello,
I am writing a shell script using sed I need to figure out how I can store the
output of
grep florida roam.db | sed -e s/^.*\? //g
to a variable. roam.db has entries like, one per line.
florida: 555-1212
you mean, in a shell variable? In bash and maybe sh this should work :
Ben Lutgens wrote:
I had to use the back quotes``
Back quotes can't be nested, while $( ) does the same job and can be nested
--
http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=45690
50 matches
Mail list logo