- 论坛徽章:
- 0
|
try:
- [20:04:56-Bob@hzling20:~/tmp/1]-(1320)No.319->$ cat name.txt
- 1.txt, one
- 2.txt ,one
- 3.txt ,two
- 11.txt ,three
- 5.txt ,four
- [20:05:00-Bob@hzling20:~/tmp/1]-(1321)No.320->$ for i in `awk -F' *, *' '{print $2}' name.txt | uniq`; do mkdir $i && cd $i && touch `grep $i ../name.txt | awk -F' *, *' '{print $1}'` && cd ..; done
- [20:05:06-Bob@hzling20:~/tmp/1]-(1322)No.321->$ tree
- .
- |-- four
- | `-- 5.txt
- |-- name.txt
- |-- one
- | |-- 1.txt
- | `-- 2.txt
- |-- three
- | `-- 11.txt
- `-- two
- `-- 3.txt
- 4 directories, 6 files
复制代码 |
|