On Wed, May 05, 2010 at 07:03:44PM +0200, Jörg Steffens wrote:
> +function stat_details()
> +{
> +    # attention: stat uses other variables as find, eg. %u<->%U
> +    local path=${1:-.}
> +    stat -c "mode=%a user=%U(%u) group=%G(%g)" "$path"

This isn't portable, e.g. on OpenBSD you get:

stat: unknown option -- c
usage: stat [-FLnq] [-f format | -l | -r | -s | -x] [-t timefmt] [file ...]

Is there a more portable way to get at this information?

In general it's quite hard to write shell scripts that run everywhere.
Maybe just keep the original find-based code, but filter some errors?

Stefan

Reply via email to