[root@pcnet test]# cat filename
dir1
dir2
dir3 34
[root@pcnet test]# while read line; do mkdir "${line}";done < filename
[root@pcnet test]# ll
total 20
drwxr-xr-x. 2 root root 4096 Jun 17 17:12 dir1
drwxr-xr-x. 2 root root 4096 Jun 17 17:12 dir2
drwxr-xr-x. 2 root root 4096 Jun 17 17:12 dir3 34
-rw-r--r--. 1 root root 18 Jun 17 17:11 filename
-rw-r--r--. 1 root root 70 Jun 17 11:10 test.sh
转载于:https://www.cnblogs.com/liwanhong/archive/2011/06/17/2083813.html