#!/bin/bash filename=$1 for i in 1 2 do ./start.sh $i |grep text, |sed 's/ section: .text, addr: 0x40000000, size: /'"$i"',/' >$filename done