我在 while 循环中使用 grep 命令时遇到问题。下面是我的代码:
#!/bin/bash
#FILE: grep_track
#will read in a list of track IDs and grep the track data from the original track files
set=-x
track_list=Top95_HSI_forGrep.txt
track_path="/mnt/gpfs/backup/jpty_surge/kimberly/Launch_multiple_storms/input/$track_list"
outname=$track_list
#echo track_list $track_list
#echo track_path $track_path
#echo outname $outname
IFS=$","
while read trackid fileid
do
file="input/track_param_$fileid"
outfile="output/$outname"
echo fileid $fileid
echo trackid $trackid
echo file $file
echo outfile $outfile
grep $trackid $file > $outfile
done < $track_path
一切似乎都在正确读取(根据我的回声响应),但是我收到以下错误:
: No such file or directory1.txt
谁能帮我弄清楚发生了什么?谢谢!