#!/bin/bash
###########################################
# file name: ax #
# set file to be executable for all users #
###########################################
ME=`basename $0`
showHelp()
{
echo "usage $ME file_name1 [file_name2] [...]"
}
[ $# -lt 1 ] && showHelp && exit 1
FILES=$*
for VAR in $FILES
do
[ -f "$VAR" ] && VALID_FILES="$VALID_FILES $VAR"
done
if [ -n "$VALID_FILES" ]
then
CMD="chmod a+x $VALID_FILES"
echo $CMD
$CMD
RET=$?
else
echo "No valid file was found"
RET=1
fi
exit $RET
ax
最新推荐文章于 2024-08-16 15:26:30 发布