Date: Mon, 10 May 2010 12:54:57 +0800 From: Fbsd1 <fbsd1@a1poweruser.com> To: bf1783@gmail.com Cc: freebsd-questions@FreeBSD.org Subject: Re: how to find literal in file and them delete that line Message-ID: <4BE791A1.80603@a1poweruser.com> In-Reply-To: <AANLkTilGhCHDQvKa3oFWAzq_0Kh_aHRORhQfcteFn-kB@mail.gmail.com> References: <AANLkTilGhCHDQvKa3oFWAzq_0Kh_aHRORhQfcteFn-kB@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
b. f. wrote: >> Alberto Mijares wrote: snip > > It would make sense if you read the sed(1) and re_format(7) manpages. > They may be a pain at first, but they are used often and can make your > life a lot easier. There are also a lot of tutorial on the web, with > many useful examples, e.g.: > > http://sed.sourceforge.net/grabbag/ > > He is suggesting that, rather than using sh(1), you should use sed(1), > which is typically used for this sort of task, and is also part of the > base system, in some fashion like, for example: > > sed -e '/literal/d' file > > If you insist on doing this with sh(1), which will probably be less > efficient, then you can cobble something together with a 'case' > statement, or parameter expansion with substring processing. See the > sh(1) manpage. > > I hope that you are not intending to use this for a FreeBSD Port in > the context of your earlier message. As someone else has already told > you, ports should _not_ be automatically editing configuration files > like rc.conf. Instead they should just indicate what should be added > by the user or administrator in a pkg-message. Although you are free > to do whatever you want on your own system, if you submit a port that > attempts to tamper with such files to FreeBSD Ports, it is likely that > that part of your submission will be rejected. > Thank you for your kind in-sight. Using sh was again just comments to help explain what I needed help with. A list reader replied offline with examples and now I have what I needed to proceed. Thanks to all who replied.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BE791A1.80603>