To: None <firstname.lastname@example.org>
From: Martti Kuparinen <email@example.com>
Date: 11/14/2001 11:52:57
I've written a FreeBSD mergemaster-like utility to compare, merge and
install files into /etc (from /usr/src/etc). Yes, I've read the previous
"wars" on this subject but I needed a tool to do the config file update...
This script does NOT check for any CVS tags but runs cmp to find out
if the file has been updated in /usr/src/etc or not. And if it has,
the user gets a diff and possibility to merge the currently installed
and the new version, see the merged version and finally install it.
So far things have been working quite well, I've updated files in /etc
and /dev from 1.5.2 to 1.5.3_ALPHA without any problems :-)
And now the question: how should I get a file's permission in
a /bin/sh script? I don't want to make this script depend on perl
but if possible use only standard tools like ls, sed and awk.The uid and gid are
easily retrieved from ls output but I'd like to avoid
parsing the "-rwxr-xr-x" strings to produce octal number. But can it be
All comments are welcome: especially permission parsing and suggestion
for the name. I'll upload this script somewhere when I'm home (I'm on
business trip right now).