系统相关
首页 > 系统相关> > Shell - for loop

Shell - for loop

作者:互联网

2022-04-12 11:14PM
[/home/zzh/aaa]$>lh
total 8.0K
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 c.txt
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 b.txt
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 a.txt

2022-04-12 11:14PM
[/home/zzh/aaa]$>for x in *.txt; do
>> mv $x $x.bak
>> done

2022-04-12 11:16PM
[/home/zzh/aaa]$>lh
total 8.0K
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 c.txt.bak
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 b.txt.bak
-rw-rw-r-- 1 zzh users    0 Apr 12 05:08 a.txt.bak

 

标签:12,05,08,Shell,rw,zzh,txt,loop
来源: https://www.cnblogs.com/zhangzhihui/p/16139414.html