Hi, Attached is a bit of hget + rc + sam -d to get recent AP newswire stories. It has two modes - without an arg it lists the stories, with one it prints that story. The if statement seems to confuse the here document syntax of rc and it start interpreting the tmp file as commands - all very odd. If I remove the if statement and implement the program as two scripts envoked seperately it works so the basic code must be right... I think. I tried running the sam -d here document in a subshell ( @{...} ) but it still did the same thing. Confused of Winchester, -Steve