日期:2014-05-16 浏览次数:20643 次
#!/bin/bash for i in `ls /tmp/log` do #echo $i ds=`ls /tmp` ds2=`echo $ds|grep "$i"` if [ "$ds2" != "" ] then #echo $ds2 echo $i ${ds#*$i} fi #${ds/*$i/$i} && echo $result || echo '' done
------解决方案--------------------
fileA=`ls ./a` ls -1 ./b | sed -n "/$fileA/,\$p"