The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
remsh doesn't work som.nitk UNIX for Advanced & Expert Users 4 06-16-2009 10:49 AM
remsh + HPUX belfastbelle HP-UX 3 09-29-2008 12:11 PM
How To Run AWK via Remsh? Korn0474 Shell Programming and Scripting 6 09-17-2008 12:17 AM
remsh kazanoova2 UNIX for Dummies Questions & Answers 3 12-21-2004 10:39 AM
remsh and run script bugggg Shell Programming and Scripting 1 11-13-2002 05:23 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-13-2009
Korn0474 Korn0474 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 23
How To Grep Via REMSH

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

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?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0