Well with that first code, I just copied what you had and only 'fixed' the part that wasn't working, which was the loop). That particular command could simply have been "search2 $1-"