a*n
3 楼
#!/bin/sh -xv
#To get little hints please delete -xv flags
#remove first three lines of everyfile in current directory
#except the shell program
for file in `ls`
do
if ( test -f $file && test $file != `basename $0` )
then
sed 1,3d $file > $file.tmp
mv $file.tmp $file
else
echo "$0: $file can't be changed" 1>&2
fi
done
【在 R**g 的大作中提到】
: 怎么把一个目录下的所有文件的前3行删除?
: 谢谢!
#To get little hints please delete -xv flags
#remove first three lines of everyfile in current directory
#except the shell program
for file in `ls`
do
if ( test -f $file && test $file != `basename $0` )
then
sed 1,3d $file > $file.tmp
mv $file.tmp $file
else
echo "$0: $file can't be changed" 1>&2
fi
done
【在 R**g 的大作中提到】
: 怎么把一个目录下的所有文件的前3行删除?
: 谢谢!
R*g
4 楼
thank you very much. It really saves me lots of time.
【在 a***n 的大作中提到】
: #!/bin/sh -xv
: #To get little hints please delete -xv flags
: #remove first three lines of everyfile in current directory
: #except the shell program
: for file in `ls`
: do
: if ( test -f $file && test $file != `basename $0` )
: then
: sed 1,3d $file > $file.tmp
: mv $file.tmp $file
【在 a***n 的大作中提到】
: #!/bin/sh -xv
: #To get little hints please delete -xv flags
: #remove first three lines of everyfile in current directory
: #except the shell program
: for file in `ls`
: do
: if ( test -f $file && test $file != `basename $0` )
: then
: sed 1,3d $file > $file.tmp
: mv $file.tmp $file
相关阅读
how to install speedbar on xemacs?how to setup lib path?Who knows this shell varialbe?cxterm compileHELP! about running cxtermhow to find a specified file in the unix?[转载] .SO no symbol?哪位装过SCO在PC机子上?求助,文件删除不掉.怎样将一个大文件分成两个文件?lost some data?Help with HVisionHelp on shell scriptHelp: what does it mean?这几个网络模拟软件哪个比较好啊?some wtmultiple file copyInstallation of cxterm on SGI[转载] molscript and graspSunOS 5.5 / Solaris 2.5 Installation CDs