0
인수 예제 : 간단한 쉘 스크립트
../path/cse/lab3/remove
지금은 'lab3'에있는 모든 디렉토리 및 파일을 인쇄합니다. 'remove'에있는 모든 파일을 출력하고 싶습니다. 어떻게하는지 잘 모르겠습니다. for 루프를 사용하고 싶습니다.
코드 : 또한
if test -d $1 #check if argument is a directory.
then
for fileName in *
do
echo "what is this::: $fileName"
done
fi
방법 문자열이 같은 것을보고 나는이 모든 파일을 인쇄 할 :
remove/test.out
remove/test2.out
서식을 보려면 ['basename'] (http://linux.die.net/man/1/basename) 명령을 참조하십시오. –