How To Grep Via REMSH

Well I didn't think this would be so complicated when I started it but, well, here we are. :frowning:

I'm trying to REMSH to other servers and run a grep command. Now this works just fine until the item I'm grepping for has whitespaces in it and then UNIX gets stubborn.

Normally one would grep for a criteria with whitespaces simply by putting the item in quotes like this:
grep "Hello World" file.txt

But add in the REMSH command:
remsh server grep "Hello World" file.txt

and suddenly you get an error message:
grep: can't open World

Argh!

Now the only way I have found to get around this is to add a backslash in front of the white space like this:
remsh server grep "Hello\ World" file.txt

But the keyword is going to be input by end users and it's not reasonable to ask them to put backslashes in front of all their spaces.

Anybody have any ideas? :confused:

It's the quotes not the spaces which need protecting from the local shell so that they get passed to the remote shell.

remsh server grep \"Hello World\" file.txt