マイスクリプトスクリプトでファイル拡張子が認識されないのはなぜですか?
#!/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'で終わる文字列ではないので、あなたのエラーがあります。 –