#!/bin/sh
#
# lsmode - print octal mode for a file

if [ "$#" -ne 1 ]; then
  echo "Usage: $(basename "$0") path" >&2
  exit 1
fi

stat=$(command -v gstat 2>/dev/null || echo stat)
${stat} "$1" | sed -n 's/^Access: (\([0-9]\{1,\}\).*/\1/p'
