topic:
Shell design a program established under / userdata directory 50 directory, namely user1 ~ user50, and set permissions for each directory, where the permissions for other users: Read; file owner permissions are: read, write, execute; permission for the file owner's group: read, execute.
answer:
#!/bin/bash mkdir ./userdata if [ $? -eq 0 ]; then i=1 while [ $i -le 50 ]; do mkdir -p ./userdata/user$i chmod 754 ./userdata/user$i let i++ done else echo "end" exit 1 fi exit 0