내 스크립트스크립트가 파일 확장자를 인식하지 못하는 이유는 무엇입니까?
#!/bin/bash
cp *.ats /home/milenko/procmt
mycd() {
cd /home/milenko/procmt
}
mycd
EXT=ats
for i in *; do
if [ "${i}" != "${i%.${EXT}}" ];then
./tsmp -ascii i
fi
done
그러나
[email protected]:~/Serra do Mel/MT06/meas_2016-07-13_20-22-00$ bash k1.sh
./tsmp: handling 1 files ************************************** total input channels: 1
the name of your file does not end with ats ... might crash soon
main (no rda) -> can not open i for input, exit
./tsmp: handling 1 files ************************************** total input channels: 1
the name of your file does not end with ats ... might crash soon
main (no rda) -> can not open i for input, exit
내가
[email protected]:~/procmt$ ls *.ats
262_V01_C00_R000_TEx_BL_2048H.ats 262_V01_C00_R086_TEx_BL_4096H.ats 262_V01_C02_R000_THx_BL_2048H.ats
262_V01_C00_R000_TEx_BL_4096H.ats 262_V01_C01_R000_TEy_BL_2048H.ats 262_V01_C03_R000_THy_BL_2048H.ats
내 스크립트에 어떤 문제가 디렉토리 목록 파일을 procmt로 이동? 만약 내가 제대로 이해하고
'./tsmp -ascii i'는'./tsmp -ascii "가 아닙니다. $ i"'; 변수를 전혀 확장하지 않으므로 항상 파일 이름으로'i'를 사용합니다. 'i'는'.ats '로 끝나는 문자열이 아니므로 오류가 있습니다. –