问题是这样的,想在当前目录下,把子文件下的文件copy到当前目录下,并修改扩展名lyric为lrc
目录结构:
./
|____directory1
|______file1.lyric
|______file2.lyric
|____directory2
|______file3.lyric
|______file4.lyric
code:
#!/bin/bash
DIRS=`ls -l | grep ^d | awk '{print $8}'`;
for i in $DIRS;do
SUBDIRS=`ls -l "$i" |grep ^- | awk '{print $8}' |cut -d . -f1`;
for j in $SUBDIRS;do
`cp $i'/'$j'.lyric' $j'.lrc'`;
done
done
目录结构:
./
|____directory1
|______file1.lyric
|______file2.lyric
|____directory2
|______file3.lyric
|______file4.lyric
code:
#!/bin/bash
DIRS=`ls -l | grep ^d | awk '{print $8}'`;
for i in $DIRS;do
SUBDIRS=`ls -l "$i" |grep ^- | awk '{print $8}' |cut -d . -f1`;
for j in $SUBDIRS;do
`cp $i'/'$j'.lyric' $j'.lrc'`;
done
done
Powered by ScribeFire.
没有评论:
发表评论