> > grep vpopmail /etc/passwd | awk -F ":" '{print $6}'
> >
> > or
> >
> > grep vpopmail /etc/passwd | cut -d':' -f6

I would think that cut would be more portable.  However, every machine
I've used has had some variant of awk installed too.

You might want to consider using 'grep ^vpopmail' or even 'grep
^vpopmail:' rather than 'grep vpopmail' to ensure that you're only getting
the 'vpopmail' user.  (I have a server in which we've had to transparently
migrate users who were set up under sendmail so we have users whose home
directories are under the vpopmail directory.  Nasty, I know.)  The one
catch is that I don't know if 'grep ^string' is supported in all versions
of 'grep'.

> > Reason I'm asking is I'm making some minor modifications to the Makefile
> > for the chkuser patch and I want to make sure they're as absolutely
> > portable as possible before releasing it to the masses.
> also, while on the topic of portability, I noticed that djb does not include
> ANY variable substitutions (only backtick ` ` substitutions) in his Makefile.
> I'm curious if this is also for portability reasons.  Anyone aware of any
> implementations of the 'make' program that don't understand variable
> substitions in Makefiles, or any situations (lack of /bin/sh compatible
> shell, perhaps?) that might make variable substitutions not possible?

I don't know of any portability concerns in this regard.  I wonder if this
is just a design choice.


Chris Ess
System Administrator / CDTT (Certified Duct Tape Technician)

Reply via email to