I'm guessing you mean all files that match *h*.csv
, in which case you might want to use a for
loop like this:
for i in *h*.csv; do
while read line; do
# do some stuff, e.g. echo "$line"
done < "$i"
done
In case it is a possibility that you have any directories that match the pattern, you might want to also add a test to ensure that each item in the loop is a file. That would be:
for i in *h*.csv; do
if [ -f "$i" ]; then
while read line; do
echo "$line"
done < "$i"
fi
done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…