making a better RSYNC script --help

2003-06-24 Thread Timothy Stone
RH List Fellows: I use the following shell script that I invoke at the command line that "bulk" updates my production web server (windoze 2k + cygwin) via ssh on my staging server (rhl8) #!/bin/sh # # rsync -rtplzv --delete -e ssh ./stage-docroot \ # [EMAIL PROTECTED]:/cygdrive/c/usr/local/apac

RE: Bash script help ?

2003-02-05 Thread David Simmons
[ test ] then Dave -Original Message- From: R P Herrold [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 12:11 PM To: [EMAIL PROTECTED] Subject: RE: Bash script help ? On Wed, 5 Feb 2003, David Simmons wrote: > I have noticed in this thread that everyone is puttin

RE: Bash script help ?

2003-02-05 Thread R P Herrold
On Wed, 5 Feb 2003, David Simmons wrote: > I have noticed in this thread that everyone is putting a ";" after their > tests: if [ test ] ; and for [ test ] ; > > When is the ";" required or is it always required after the test in a > conditional statement? Ehhh? Not all people do. I never

Re: Bash script help ?

2003-02-05 Thread Raymundo M. Vega
quot; required or is it always required after the test in a conditional statement? Thanks, Dave Simmons -Original Message- From: Raymundo M. Vega [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 11:00 AM To: [EMAIL PROTECTED] Subject: Re: Bash script help ? I think sev

RE: Bash script help ?

2003-02-05 Thread David Simmons
undo M. Vega [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 11:00 AM To: [EMAIL PROTECTED] Subject: Re: Bash script help ? I think several lines are not quite right: - regular expression in gawk should be inside the {}, but you will have to pass the argument to gawk. - next line aft

Re: Bash script help ?

2003-02-05 Thread Raymundo M. Vega
I think several lines are not quite right: - regular expression in gawk should be inside the {}, but you will have to pass the argument to gawk. - next line after if should be then, it is usually used like if [ -z "$processid" ] ; then the script will only echo first time it finds the string,

Re: Bash script help ?

2003-02-05 Thread Ryan Babchishin
[EMAIL PROTECTED] wrote: I'm trying to get a pidof a php script by capturing the path: like /home/somebody/my_script which will be the first arg. to the bash script Could anybody tell me what's wrong with this script ? I'm new to scripting in general so any help would be apreciated ! #!/bin/ba

Re: Bash script help ?

2003-02-05 Thread Lars
On Wednesday, February 5, 2003, at 02:24 PM, Jan wrote: In your awk stmt you search for '1st_arg' rather than the value of the variable 1st_arg, which would be $1st_arg - or perhaps ${1st_arg}, as $1 is something else... Ok ! Thanks ! Lars -- redhat-list mailing list unsubscribe mailto:[E

Re: Bash script help ?

2003-02-05 Thread lardi
>Jon Haugsand wrote: >> * [EMAIL PROTECTED] >> >>>#!/bin/bash >>>1st_arg=$1 >> >> number not allowed in front. >> >> >>>prosesses=`lsof -i` >>>prosessid=`echo $prosesses | gawk /1st_arg/'{print $2}'` >> >> Cannot understand this to work in gawk. In any case, you might do >> this a lot more e

Re: Bash script help ?

2003-02-05 Thread Jan
Jon Haugsand wrote: * [EMAIL PROTECTED] #!/bin/bash 1st_arg=$1 number not allowed in front. prosesses=`lsof -i` prosessid=`echo $prosesses | gawk /1st_arg/'{print $2}'` Cannot understand this to work in gawk. In any case, you might do this a lot more effective: echo $prosessid if [ -z

Re: Bash script help ?

2003-02-05 Thread Jon Haugsand
* [EMAIL PROTECTED] > #!/bin/bash > 1st_arg=$1 number not allowed in front. > prosesses=`lsof -i` > prosessid=`echo $prosesses | gawk /1st_arg/'{print $2}'` Cannot understand this to work in gawk. In any case, you might do this a lot more effective: > echo $prosessid > if [ -z "$prosessid" ] mis

Re: Bash script help ?

2003-02-05 Thread Jan
[EMAIL PROTECTED] wrote: I'm trying to get a pidof a php script by capturing the path: like /home/somebody/my_script which will be the first arg. to the bash script Could anybody tell me what's wrong with this script ? I'm new to scripting in general so any help would be apreciated ! #!/bin/ba

Bash script help ?

2003-02-05 Thread lardi
I'm trying to get a pidof a php script by capturing the path: like /home/somebody/my_script which will be the first arg. to the bash script Could anybody tell me what's wrong with this script ? I'm new to scripting in general so any help would be apreciated ! #!/bin/bash 1st_arg=$1 prosesses=`l

Re: script help

2002-04-30 Thread David Talkington
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 tim wrote: > Faced with having to re-ip a set of machines that have ip address hard >coded all over the place in various application and system configuration >files, what would be the best way to globally change them? while () { s/^BOOTPROT0

script help

2002-04-30 Thread tim
Hi there, Faced with having to re-ip a set of machines that have ip address hard coded all over the place in various application and system configuration files, what would be the best way to globally change them? I'm thinking of a find and xargs perl replace sort of thing. Any better ideas? This

Re: Script help? [OT?]

2000-04-20 Thread Gordon Messmer
Gate wrote: > Can anyone give me a hand? Thanks in advance! I got bored, so I wrote the attached perl script. It does pretty close to what you said you wanted, but I wrote it the way I think such a script should be written. It should be easier to use in the future, if you need to do something v

Re: Script help? [OT?]

2000-04-16 Thread Don Knott
On Thu, 13 Apr 2000, Gate wrote: > What I need is this. > > -# of times user logged in to nas Bud-PM2 > -Total number of logins > -Username > -All ONLY correct logins (i.e. the "Login OK"). > > and printed to a file like this: > > username:Budlogs:Totlogs > > Can anyone give me a hand? Thanks

Script help? [OT?]

2000-04-15 Thread Gate
I have a logfile that contains entries like so: Wed Apr 12 04:45:04 2000: Auth: Login OK: [user/test123] (from nas Weis-PM3) Wed Apr 12 04:45:04 2000: Auth: Login OK: [user2/123test] (from nas Bud-PM2) Wed Apr 12 04:41:09 2000: Auth: Login incorrect: [user3/1badpass] (from nas Weis-PM3) Each is

Script help?

2000-04-13 Thread Gate
I have a logfile that contains entries like so: Wed Apr 12 04:45:04 2000: Auth: Login OK: [user/test123] (from nas Weis-PM3) Wed Apr 12 04:45:04 2000: Auth: Login OK: [user2/123test] (from nas Bud-PM2) Wed Apr 12 04:41:09 2000: Auth: Login incorrect: [user3/1badpass] (from nas Weis-PM3) Each is

Re: OT - Change files permissions script help pls

1999-12-13 Thread Dan Horth
At 20:27 +1000 13/12/99, a mole wrote: >'unowned' files in /etc so.. Assuming I didn't misunderstand your problem >I think this should work out... Excellent... chugged away and fixed everything... well after changing the chmod to "chmod $mode, $targfile" - the only problem was that the script

Re: OT - Change files permissions script help pls

1999-12-13 Thread Charles Galpin
I didn't run this, but it looks like your chmod line should read chmod $mode, $targfile; instead (you where chmoding the backup). Anyway, I do believe this addresses his problem. charles On Mon, 13 Dec 1999, a mole wrote: > #!/usr/bin/perl > > use strict; > use File::Basename; > use IO::File;

Re: OT - Change files permissions script help pls

1999-12-13 Thread a mole
Hey Dan, RPM has a fairly groovey feature which will let you reset the permissions to match their stored values in the rpm database. For starters something like... rpm -q -a | xargs rpm --setperms ... will set most of your box to rights. Except there are quite a few 'unowned'

OT - Change files permissions script help pls

1999-12-12 Thread Dan Horth
ok - here's the scenario... I stupidly managed to change all the files in my /etc/ directory to 755 permissions (directories too) and now things are complaining and I also think that this is not a very secure way for my /etc/ directory to be... I have a backup of this directory with all the c