for i in $(ls);do if [ $i = '*.java' ];then echo "I do something with the file $i" fi done
不需要花哨的技巧:
原文链接:https://www.f2er.com/bash/390006.htmlfor i in *.java; do ... done
for i in $(ls);do if [ $i = '*.java' ];then echo "I do something with the file $i" fi done
for i in *.java; do ... done