> ROOTDEV=$(ssh $HOST awk < /boot/grub/grub.conf '/^#.*root=/ {print $5}') > > You had embedded single quotes. Also, you didn't need cat or grep. Also, > the = sign and the # don't need to be backquoted. Also, the output of awk > being assigned to ROOTDEV was simply being dropped. also i'm rubbish at scripting! thanks to all those who helped it now works fine cheers