dir_output.sh配合datafile-generate.sh脚本,生成文件/目录信息
This commit is contained in:
parent
611582f02d
commit
d92b311395
|
@ -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
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
if test -d "$1"
|
||||
then
|
||||
echo "directory"
|
||||
else
|
||||
echo "file"
|
||||
fi
|
Loading…
Reference in New Issue