Re: Shell script help
From: Paul Schmehl (pauls_at_utdallas.edu)
Date: 07/30/05
- Previous message: Eric Schuele: "Re: dhclient and wpa_supplicant"
- In reply to: Parv: "Re: Shell script help"
- Next in thread: Parv: "Re: Shell script help"
- Reply: Parv: "Re: Shell script help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 30 Jul 2005 14:35:31 -0500 To: f-q <freebsd-questions@freebsd.org>
--On July 30, 2005 2:57:57 AM -0400 Parv <parv@pair.com> wrote:
> in message <E9E44D6085C02C80E233D138@Paul-Schmehls-Computer.local>,
> wrote Paul Schmehl thusly...
>>
>> Running what I *thought* was the same sed command in the Makefile
>> of the port doesn't solve the problem of the formatting of the man
>> pages, but it doesn't generate any errors either:
>>
>> @${SED} -e '/man\.macros/r man.macros' -e '/man\.macros/d'
>> ${WRKSRC}/doc/${f} \
>> > ${WRKDIR}/${f}
>>
>> Can someone explain what the sed command is doing? The man page
>> isn't much help.
>
> In the 1st part, sed sends the output of file 'man.macros' to
> standard out if it exists (otherwise no worries) when sed sees the
> 'man\.macros' pattern.
>
> And the 2d part, just deletes that pattern.
>
> There in the sed(1) man page all is. Or, line by line try this ...
>
> rm -f q ; echo polka > p
> { echo p ; echo q; echo p; } | sed -e '/p/r p' -e '/p/d'
> { echo p ; echo q; echo p; } | sed -e '/p/r q' -e '/p/d'
>
Thanks! That was the answer. I had to fiddle with it for a while before I
understood what it was doing, but it does exactly what I need it to do now.
Paul Schmehl (pauls@utdallas.edu)
Adjunct Information Security Officer
University of Texas at Dallas
AVIEN Founding Member
http://www.utdallas.edu/
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
- Previous message: Eric Schuele: "Re: dhclient and wpa_supplicant"
- In reply to: Parv: "Re: Shell script help"
- Next in thread: Parv: "Re: Shell script help"
- Reply: Parv: "Re: Shell script help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: Shell script help
... wrote Paul Schmehl thusly... ... > of the port doesn't solve the problem
of the formatting of the man ... And the 2d part, just deletes that pattern. ...
(freebsd-questions) - Re: bash/echo/sed/date question (?)
... shell script. ... The sed command is used to dynamically create the ...
replacement pattern more dynamic as a general exercise. ... (comp.unix.shell) - Re: can sed pattern contain < & > characters or not?
... am trying with sed command like ... > found in pattern". ...
his wife, Queen ChessBlindness? ... (comp.unix.shell) - replacing variable in sed command
... Can anyone tell me how do i substitute some shell variable in the search ...
pattern of a sed command. ... (comp.unix.questions) - sed substitution over different files
... I'd like to write a sed command which would: ... parse one file to find
a pattern ... search in another file for the matched pattern ... P.S. and am I allowed
to use single quotes to make it a shell command ... (comp.unix.shell)