How to prevent filename expansion in for loop in bash

前端 未结 2 364
盖世英雄少女心
盖世英雄少女心 2021-01-19 21:53

In a for loop like this,

for i in `cat *.input`; do
    echo \"$i\"
done

if one of the input file contains entries like *a, i

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-19 22:08

    For the example you have, a simple cat *.input will do the same thing.

提交回复
热议问题