shell脚本中find执行存在问题,哪位大侠看下
部分脚本如下:foriin$(ls${filepath}/${filename}2>/dev/null)dounzip$i-d${fileforwardpath}slee...
部分脚本如下:
for i in $(ls ${filepath}/${filename} 2>/dev/null)
do
unzip $i -d ${fileforwardpath}
sleep 3
echo ${fileforwardpath}
sqlnum=`find ${fileforwardpath} -maxdepth 1 -name *.sql|wc -l`
执行该脚本find命令报错
Archive: /opt/***/dbscript_2013111223.zip
inflating: /opt/***//run/0_aa.sql
inflating: /opt/***/1_bb.sql
/opt/***/run
find: paths must precede expression: 1_bb.sql
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
望解决
是unzip -o $i -d ${fileforwardpath} 展开
for i in $(ls ${filepath}/${filename} 2>/dev/null)
do
unzip $i -d ${fileforwardpath}
sleep 3
echo ${fileforwardpath}
sqlnum=`find ${fileforwardpath} -maxdepth 1 -name *.sql|wc -l`
执行该脚本find命令报错
Archive: /opt/***/dbscript_2013111223.zip
inflating: /opt/***//run/0_aa.sql
inflating: /opt/***/1_bb.sql
/opt/***/run
find: paths must precede expression: 1_bb.sql
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
望解决
是unzip -o $i -d ${fileforwardpath} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询