On Mon, 2005-10-03 at 12:04 +0200, Diego 'Flameeyes' Pettenò wrote:
> On Monday 03 October 2005 11:14, Duncan wrote:

Hello Duncan.

> Actually, bash is fine, as long as you declare #!/bin/bash the script. Every 
> Gentoo/ALT system should have bash installed as part of base system, as bash 
> is what the ebuilds are written in. 

Good as this is what I was working from.  I've coded the parts that
extract and parse the information from the /etc/{passwd,group} files
already as well as reading and writing the config files and not found it
necessary to make any head, tail, sed, grep, awk, wing and a prayer
calls.  :)    As I said, I want to write this in bash itself as much as
possible for portability.

> > Likewise, keep in mind POSIX compatibility when making any
> > sed/grep/file/etc calls.  Don't assume the GNU versions.  If you need the
> > info, I believe most of the manpages specify where the GNU versions
> > deviate from POSIX. 
> Also here the point is not to avoid GNU calls on every tool, is just to make 
> sure that the tool called is actually GNU :)
> The insidious GNUisms are the ones relative, for example, to cp or mv, which 
> are base system commands. But GNUisms in sed calls are usually safe as long 
> as you make sure that you're calling GNU sed. Ebuilds sanitize this aliasing 
> it to gsed, while eselect uses aliases that checks the right tool to use.
> 
> You can give a look to 
> http://www.gentoo.org/proj/en/gentoo-alt/maintnotes.xml#doc_chap2 to have a 
> list of common problems with GNUisms.

Thanks for the link.  Once I start searching for processes to kill and
files to delete I'm sure that will become a good reference.  I'm
thinking that these will be the only needed external programs:

find
ps
tar
gzip ? (or something else to compress things with)

I might write a test function to the install system to verify the
existence of the correct tools and switch to the correct syntax if I
need to.  Although Gentoo is my primary goal I want things to work on a
minimal system of any flavor of *nix that has bash.  That goal may have
to be abandoned though.  We'll see.

Regards,
-- 
Tres Melton
IRC & Gentoo: RiverRat


-- 
gentoo-dev@gentoo.org mailing list

Reply via email to