日期:2014-05-16 浏览次数:20735 次
#!/bin/bash for file in *.c; do name=${file/%.c/}.d if [ -e ${name} ]; then echo ${name} fi done ------解决方案--------------------
#!/bin/bash for i in *.c; do name=${i/.c/.d} if [ -e ${name} ]; then echo ${name} fi done