【发布时间】:2014-05-25 11:07:43
【问题描述】:
这段代码是我想给两个目录,这段代码会查看这两个目录是否包含两个包含相同信息的文件,并询问我要删除哪个文件。
我已经写了这段代码,但我不知道如何编写删除文件的代码,请帮助
#!bin/bash
echo "give the first directory"
read firstdir
echo "give the second directory"
read seconddir
for i in ` ls $firstdir`
do
echo $i
t= `md5sum $firstdir/$i`
s= `md5sum $seconddir/$i`
if [ "$t" ! = "$s" ]
then
echo " of which directory will be eliminated? $i"
read direct
( here I want the code to delete the directory ex : delete direct/i )
fi
done
【问题讨论】:
标签: linux file directory delete-file