두 기계에서 CentOS 6.4 최종본을 사용하고 있습니다. 나는 스크립트를 실행하고있다. 스크립트는 find
명령find : 경로 앞에 표현식을 사용해야합니다.
path=$1
searchstring=$2
echo `find $path -name $searchString`
for filename in `find $path -name $searchString`
do
echo "$filename"
echo
done
./findfiles.sh /var/log/ *.txt
위의 스크립트는 잘 실행하고 파일을 인쇄하고이 포함되어 있습니다. 그러나 두 번째 컴퓨터에서 나는 usage error: find: paths must precede expression
이유는 무엇입니까 것은 뒤에 그것을 잘 실행 find $path -name "$searchString"
에 파일 이름을 을 변경 찾기 command.After 확대되었다 .txt를 *입니다.
첫 번째 CentOS 컴퓨터에서 구문 오류가 발생하지 않는 이유는 무엇입니까?
유사 : http://stackoverflow.com/questions/6495501/find-paths-must-precede-expression-how-do-i-specify-a- recursive-search-that – trante