直接上代码 memleak.sh: #!/bin/sh i=1 until [ ! "$i" -le 10 ] do val=$(pidof converter) if [ -z "$val" ]; then ret=$(pmap -d $val | tail -1) fi mytime=$(date "+%Y-%m-%d %H:%M:%S") filetime=$(date "+%Y-%m-%d") echo "[$mytime] [$ret]" >> memleak_$filetime.leak sleep 5 done (责任编辑:IT) |