You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
380 B

options="-d "
all_files=""
optstring=":la"
while getopts "${optstring}" arg; do
case "${arg}" in
a) options+="-a " && all_files=".*/" ;;
l) options+="-l " ;;
?)
echo "Invalid option: -${OPTARG}."
;;
esac
done
for last; do true; done
echo "$options"
if [ -d "$last" ]; then
cd "$last"
ls $options */ $all_files
else
ls $options */ $all_files
fi