[root@liu ~]# vim threefile.sh
#/bin/bash
# 生成一个随机的三位数
number=$((RANDOM%900 + 100))
# 创建文件
touch "$number.txt"
# 输出结果
echo "$number.txt 文件已创建"
#添加权限
[root@liu ~]# chmod +x threefile.sh
[root@liu ~]# ./threefile.sh
185.txt 文件已创建
[root@liu ~]# ./threefile.sh
915.txt 文件已创建
[root@liu ~]# ll
总用量 18
-rw-r--r--. 1 root root 0 9月 11 19:52 185.txt
-rw-r--r--. 1 root root 0 9月 11 19:52 915.txt
-rwxr-xr-x. 1 root root 156 9月 11 19:46 luojijuan.sh
-rwxr-xr-x. 1 root root 158 9月 11 19:52 threefile.sh