summaryrefslogtreecommitdiff
path: root/home/xyz/.local/bin/chmodef
blob: 446bc23038c9d5ef860d06d5495bd814ec7f83f1 (plain)
1
2
3
4
5
6
#!/bin/sh
# chmodef: CHMOD DEFault

# https://wiki.archlinux.org/title/File_permissions_and_attributes#Numeric_method
find "$@" -type d -execdir chmod 755 -- '{}' \+
find "$@" -type f -execdir chmod 644 -- '{}' \+
tz_from="Asia/Shanghai";; f) tz_from="$(tzselect)";; F) tz_from="$OPTARG";; # one extra ',' at the end will not let `for tz in ...` loop one extra time? t) for i in $(seq "$OPTARG"); do tz_to="$(tzselect),$tz_to" done;; T) tz_to="$OPTARG,$tz_to";; \?) exit 1;; esac done shift $((OPTIND-1))