grep -f fails when using rsh but wrks locally

grep -f fails when using rsh but wrks locally

Post by Nigel Kellet » Thu, 12 Dec 2002 02:05:38



Hi Y'all
This is a repost cause I changed emails

I have a script  ( called update) which cleans the passwd and shadow
files of old users and adds new users. Whe I run the script locally it
wrks fine . when I run it remotey ( rsh $host "scriptname"  ) the grep
-f option fails and gives no output
Any ideas

::::::::::::::
update
::::::::::::::
#!/bin/csh

if ( `uname -s` == "SunOS" ) then
        alias grep /usr/xpg4/bin/grep
endif

##############################################
#this has to be run on the local machine no rsh-- till I fugure out why
won't run
#remotly  Has to do with grep -f option????
###################################################

#awk -F: ' {print $1}' /etc/passwd.users > /etc/passwd.usernames
#grep  -v -f passwd.usernames  /etc/shadow > /etc/shadow.orig
#cat /etc/shadow.user >> /etc/shadow.orig
#cp /etc/shadow.orig /etc/shadow
#
#grep  -v -f passwd.usernames  /etc/passwd > /etc/passwd.orig
#cat /etc/passwd.users >> /etc/passwd.orig
#cp /etc/passwd.orig /etc/passwd
#

--
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

 
 
 

grep -f fails when using rsh but wrks locally

Post by mats.blomstr.. » Thu, 12 Dec 2002 06:45:01



> I have a script  ( called update) which cleans the passwd and shadow
> files of old users and adds new users. Whe I run the script locally it
> wrks fine . when I run it remotey ( rsh $host "scriptname"  ) the grep
> -f option fails and gives no output
> Any ideas

Is the script on $host ? Specify absolute pathname to the script.
//Mats

--
My code (if any) in this message are Copyright (C) 2002 Mats Blomstrand
and licensed under GNU GPL, http://www.gnu.org/licenses/gpl.html

 
 
 

grep -f fails when using rsh but wrks locally

Post by Robert Heuse » Thu, 12 Dec 2002 08:05:00


[snip]

Quote:> wrks fine . when I run it remotey ( rsh $host "scriptname"  ) the grep
> -f option fails and gives no output
[snip]
> #awk -F: ' {print $1}' /etc/passwd.users > /etc/passwd.usernames
> #grep  -v -f passwd.usernames  /etc/shadow > /etc/shadow.orig

[snip]

Are you sure your working directory is /etc on the remote host?
You put the names you will be grepping for in /etc/passwd.usernames
and then tell grep to use the file paswd.usernames. How should grep know
where to find that file?

HTH
Robert

 
 
 

1. Grep -f wks fine locally but fails when using rsh -why?? any ideas

Hi Y'all

Have a C shell script that calls
grep -v -f "pattern file"  /etc/passwd >  rem.users

This command wrks fine locally but when I rsh into the same machine the
"grep -f" line gives no putput. Any suggestions
tanks in advance

--

"There are 10 kinds of people in the world:
Those who understand binary, and those who don't."

2. Changing root password details under Trusted Solaris?

3. howdoIwrite2AgroupWritableFile;echo hi>foo #fails,touch wrks

4. FA: RS/6000 SP2 System

5. How to make grep select both lines using only a single 'grep' command

6. hidden assumptions in generic_file_write

7. prompted password when I rsh locally

8. MWAVEM 1.0 on thinkpad 600E - cannot configure

9. Using grep -v and grep -C together

10. Securing locally w/ rsh - concerns/questions...

11. grep sTerm * | grep -v grep ???

12. tail | grep | grep | grep

13. mounting locally nfs fails...