dir_output.sh配合datafile-generate.sh脚本,生成文件/目录信息

This commit is contained in:
wlx 2011-03-04 11:30:15 +00:00
parent 611582f02d
commit d92b311395
2 changed files with 9 additions and 11 deletions

View File

@ -1,19 +1,10 @@
#!/bin/bash
data_dir=$1
if [ $# -ne 2 ]
if [ $# -ne 1 ]
then
echo "Usage: $0 {DATA_DIR}"
exit 1
fi
dir_output
{
if test -d "$1"
then
echo "directory"
else
echo "file"
fi
}
rm dataset.txt
cat_txt=$$
find $data_dir | grep uuid.txt > $cat_txt
@ -26,7 +17,7 @@ if [ -e $uuid.txt ]
then
echo "do nothing! uuid重复"
else
find -L "${oneline%uuid.txt}" -exec du -b -s {} \; -exec dir_output "{}" \; >$uuid.txt
find -L "${oneline%uuid.txt}" -exec du -b -s {} \; -exec ./dir_output.sh "{}" \; >$uuid.txt
echo $uuid
sed -i '/uuid.txt$/d' $uuid.txt
fi

7
tools/dir_output.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
if test -d "$1"
then
echo "directory"
else
echo "file"
fi