[lug] simple bash Q.

D. Stimits stimits at idcomm.com
Sat Mar 9 16:01:41 MST 2002


Peter Hutnick wrote:
> 
> On Saturday 09 March 2002 03:29 pm, D. Stimits wrote:
> > ...
> >
> > > > sed rules.
> > >
> > > If I don't find a built-in way from bash I'll go ahead and use this. It
> > > seems strange though that bash wouldn't have something already for such
> > > a basic string processing command. On the other hand, maybe it'll give
> > > me an excuse to become a bit more familiar with sed.
> > >
> > > D. Stimits, stimits at idcomm.com
> > >
> > > > -Peter
> >
> > I just thought of something that makes it a bad idea to use tr for this
> > case. It is in an init script that will run after root filesystem has
> > been mounted, but not others. If /usr/ is on a separate partition it'll
> > cause the script to fail.
> 
> On my system (stock Redhat) sed lives in /bin.
> 
> I think this is pretty normal, and that you can expect to have sed in almost
> all situations.
> 
> Anyway, I just like advocating sed 'cause it makes me sound like an old timer
> ;-)

Oops, you are right. I was looking at tr for some reason (guess I had
character translation on my mind).

One other question if anyone here is familiar with init scripts (in my
case RH 7.x, but any info is desired). If an init script wishes to
transfer a new startup process from root to some other user with less
privileges, would the usual way be via su -c? Or would there be some
other convention for doing this within an init script? The script in
question will be in /etc/rc.d/init.d/, or the comparable location for
any linux distro.

D. Stimits, stimits at idcomm.com

> 
> -Peter
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list