Re: Shell Scripting Question

2003-06-24 Thread Cameron Simpson
On 08:21 24 Jun 2003, Jon Haugsand <[EMAIL PROTECTED]> wrote: | * Cameron Simpson | > | > I tend to do this: | > find dir -type f -name '*.html' -exec bsed 's|this|long/thing/with/slashes/this|g' {} ';' | > or just: | > bsed 's|this|long/thing/with/slashes/this|g' *.html | > for just the .

Re: bsed (was: Re: Shell Scripting Question)

2003-06-24 Thread Cameron Simpson
On 08:22 24 Jun 2003, Jon Haugsand <[EMAIL PROTECTED]> wrote: | * Cameron Simpson | > You can get bsed here: | > | > http://www.cskk.ezoshosting.com/cs/scripts/bsed | > | > An extremely useful wrapper for sed. | | Not much information here, is it? Can you give a short tutorial? You treat it

bsed (was: Re: Shell Scripting Question)

2003-06-23 Thread Jon Haugsand
* Cameron Simpson > You can get bsed here: > > http://www.cskk.ezoshosting.com/cs/scripts/bsed > > An extremely useful wrapper for sed. Not much information here, is it? Can you give a short tutorial? -- Jon Haugsand, [EMAIL PROTECTED] http://www.norges-bank.no -- redhat-list mailing

Re: Shell Scripting Question

2003-06-23 Thread Jon Haugsand
* Cameron Simpson > > I tend to do this: > find dir -type f -name '*.html' -exec bsed > 's|this|long/thing/with/slashes/this|g' {} ';' > or just: > bsed 's|this|long/thing/with/slashes/this|g' *.html > for just the .html files in the current directory. As far as I understood the quest

Re: Shell Scripting Question

2003-06-23 Thread Cameron Simpson
On 16:18 23 Jun 2003, Richard Crawford <[EMAIL PROTECTED]> wrote: | Jonathan Bartlett said: | > I'm very curious why you want this. Anyway, basically, go to the top | > level and run this perl script( NOTE - I haven't even tested this to see | > if it will compile, so it will likely delete all you

Re: Shell Scripting Question

2003-06-23 Thread Richard Crawford
Jonathan Bartlett said: > I'm very curious why you want this. Anyway, basically, go to the top > level and run this perl script( NOTE - I haven't even tested this to see > if it will compile, so it will likely delete all your files and set your > computer on fire. But it should give you a starti

Re: Shell Scripting Question

2003-06-23 Thread Richard Crawford
Jonathan Bartlett said: > I'm very curious why you want this. Anyway, basically, go to the top > level and run this perl script( NOTE - I haven't even tested this to see > if it will compile, so it will likely delete all your files and set your > computer on fire. But it should give you a starti

Re: Shell Scripting Question

2003-06-23 Thread Jonathan Bartlett
I'm very curious why you want this. Anyway, basically, go to the top level and run this perl script( NOTE - I haven't even tested this to see if it will compile, so it will likely delete all your files and set your computer on fire. But it should give you a starting point): #!/usr/bin/perl sub

RE: Shell Scripting Question

2003-06-23 Thread Brian Lucas
Title: RE: Shell Scripting Question Make a script using the below.  Then change to your highest folder and then run: # sh name_of_script.sh *.htm -- #!/bin/ksh tmpdir=tmp.$$ mkdir $tmpdir.new for f in $* do     sed -e 's/action="" href="http://www.the

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Ashley M. Kirchner
Bret Hughes wrote: You are correct. My applogies. 15 years putzing with computers and I still can't type. Don't feel bad - I'm going on 21 years...and I still hunt-n-peck -- W | I haven't lost my mind; it's backed up on tape somewhere. +---

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Bret Hughes
On Mon, 2002-12-16 at 13:37, Robert P. J. Day wrote: > On 16 Dec 2002, Bret Hughes wrote: > > > On Mon, 2002-12-16 at 13:03, Robert P. J. Day wrote: > > > > > > (not sure if there is a more appropriate forum for discussions > > > on scripting, are there?) > > > > > > > [EMAIL PROTECTED] is exac

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Robert P. J. Day
On 16 Dec 2002, Bret Hughes wrote: > On Mon, 2002-12-16 at 13:03, Robert P. J. Day wrote: > > > > (not sure if there is a more appropriate forum for discussions > > on scripting, are there?) > > > > [EMAIL PROTECTED] is exactly for scripting discussions bas php > perl anything that can be run f

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Bret Hughes
On Mon, 2002-12-16 at 13:03, Robert P. J. Day wrote: > > (not sure if there is a more appropriate forum for discussions > on scripting, are there?) > [EMAIL PROTECTED] is exactly for scripting discussions bas php perl anything that can be run from a command line. There are some very sharp folks

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Robert P. J. Day
(not sure if there is a more appropriate forum for discussions on scripting, are there?) On Mon, 16 Dec 2002, Ashley M. Kirchner wrote: > for fs in root etc boot yp mysql apache mail home ; do > # LOOP through the 13 (latest) days of the backup > for ((idx=13 ; idx >= 2; idx--)) ; do > #

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Robert P. J. Day
On Mon, 16 Dec 2002, Ashley M. Kirchner wrote: > # LOOP through the following directories > for fs in root etc boot yp mysql apache mail home ; do > # LOOP through the 13 (latest) days of the backup > for ((idx=13 ; idx >= 2; idx--)) ; do for idx in $(seq 13 -1 2); do ... whatever ... don

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Ashley M. Kirchner
Robert P. J. Day wrote: just to tighten things up, you might consider any or all of the following: 1) use the sequential && (and) operator: (or not, personal taste here) [ -d $SNAPSHOT/daily.$idx ] && $MV $SNAP ... etc etc ... ^^ command

Re: Shell Scripting (IF within FOR?)

2002-12-16 Thread Robert P. J. Day
On Mon, 16 Dec 2002, Cameron Simpson wrote: > BTW, you don't need all though sloshes, unless this came from a Makefile > (which I doubt because then there'd be lots of doubled $$s floating > around). > > Eg: > > for idx in 5 4 3 2 1 > do if [ -d $$SNAPSHOT/daily.$idx ] > t

Re: Shell Scripting (IF within FOR?)

2002-12-15 Thread Cameron Simpson
On 19:59 13 Dec 2002, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote: |Theoretically, in my head, this ought to function, however I wanted | to run it past by some of the shell guru's on here, see if anyone spots | any logistical problems with this. I'm trying to run a particular | command se

Re: Shell Scripting (IF within FOR?)

2002-12-14 Thread Ashley M. Kirchner
Robert P. J. Day wrote: arrrgh ... that should have said "moved to a", not "copied as". I figured as much. I understood the typo, no worries. Thanks! -- W | I haven't lost my mind; it's backed up on tape somewhere. + A

Re: Shell Scripting (IF within FOR?)

2002-12-14 Thread Ashley M. Kirchner
Robert P. J. Day wrote: first, you should delete the .6 directory, otherwise the .5 directory will be copied as *subdirectory* of .6. This is being done earlier in the script, yes. sure, but why use expr? why not just use the arithmetic built into bash, as in $SNAPSHOT/daily.$((idx+1)) ?

Re: Shell Scripting (IF within FOR?)

2002-12-14 Thread Robert P. J. Day
On Sat, 14 Dec 2002, Robert P. J. Day wrote: > On Fri, 13 Dec 2002, Ashley M. Kirchner wrote: > > > > > Theoretically, in my head, this ought to function, however I wanted > > to run it past by some of the shell guru's on here, see if anyone spots > > any logistical problems with this. I'

Re: Shell Scripting (IF within FOR?)

2002-12-14 Thread Robert P. J. Day
On Fri, 13 Dec 2002, Ashley M. Kirchner wrote: > > Theoretically, in my head, this ought to function, however I wanted > to run it past by some of the shell guru's on here, see if anyone spots > any logistical problems with this. I'm trying to run a particular > command several time (it's

RE: Shell scripting help

2002-12-04 Thread Todd A. Jacobs
On Wed, 4 Dec 2002, Ziad Samaha wrote: > cat usefile | awk -F: '{ print $1 }' No need for the pipe, since awk can read a file directly. For a small economy, use awk -F: '{ print $1 }' usefile instead. -- "Whenever I feel blue, I start breathing again." - U

RE: Shell scripting help

2002-12-03 Thread Ziad Samaha
red file. Regards, Ziad From: Mikevl <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> Subject: RE: Shell scripting help Date: Mon, 2 Dec 2002 08:17:21 +1300 MIME-Version: 1.0 Received: from mc8-f1.law1.hotmail.com ([6

RE: Shell scripting help

2002-12-01 Thread Cowles, Steve
> -Original Message- > From: Mikevl > Sent: Sunday, December 01, 2002 11:14 AM > Subject: Shell scripting help > > > Hi > > Can anybody help with this simple script > > Command is useradd userfile > > > useradd > userfile=$1 > s=0 > for i in 'cat $userfile ';do > $NAME='cut -d

RE: Shell scripting help

2002-12-01 Thread Mikevl
ld like [root@Lizzi root]# ./addscusers scusers cut -d : -f1 [root@Lizzi root]# Many thanks Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Adam H. Pendleton Sent: Monday, 2 December 2002 07:56 To: [EMAIL PROTECTED] Subject: RE: Shell scripting help

RE: Shell scripting help

2002-12-01 Thread Adam H. Pendleton
root@Lizzi root]# ./addscusers scusers > ./addscusers: =/bin/cut -d : -f1: No such file or directory > > Many thanks > > Mike > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]]On Behalf Of Robert P. J. Day > Sent: Monday, 2 Decembe

Re: Shell scripting help

2002-12-01 Thread Robert P. J. Day
On Sun, 1 Dec 2002, Bill Horne wrote: > - Original Message - > From: "Mikevl" <[EMAIL PROTECTED]> > > > > Hi > > > > Can anybody help with this simple script > > > > Command is useradd userfile > > > > > > useradd > > userfile=$1 > > s=0 > > for i in 'cat $userfile ';do > >

RE: Shell scripting help

2002-12-01 Thread Mikevl
EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bill Horne Sent: Monday, 2 December 2002 06:40 To: [EMAIL PROTECTED] Subject: Re: Shell scripting help - Original Message - From: "Mikevl" <[EMAIL PROTECTED]> > Hi > > Can anybody help with this simple

Re: Shell scripting help

2002-12-01 Thread Bill Horne
- Original Message - From: "Mikevl" <[EMAIL PROTECTED]> > Hi > > Can anybody help with this simple script > > Command is useradd userfile > > > useradd > userfile=$1 > s=0 > for i in 'cat $userfile ';do > $NAME='cut -d : -f1' > echo $NAME > done info cut. HTH. Bill

Re: Shell Scripting

2002-06-13 Thread David Talkington
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Kramer wrote: >You are absolutely correct. catting a file and writing to the same file >at the end of the pipe will never work. You can simulate it with perl's >-i parameter, but even that uses a temp file behind the curtains. Sorry >abou

RE: Shell Scripting

2002-06-11 Thread Stephen_Reilly
sed /'\'/,/'\'/d /www/conf/httpd.conf will do it, leave out the '/' in the second RegEx match steve -Original Message- From: Jesse Angell [mailto:[EMAIL PROTECTED]] Sent: 11 June 2002 02:29 To: [EMAIL PROTECTED] Subject: Shell Scripting I need to have a script open the file /www/conf/h

Re: Shell Scripting

2002-06-10 Thread Jesse Angell
Just the one for the specified user - Original Message - From: "daniel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 8:43 PM Subject: Re: Shell Scripting > what exactly do you want to delete? > everything between and > or all

Re: Shell Scripting

2002-06-10 Thread daniel
what exactly do you want to delete? everything between and or all of your virtualhosts? or just the ones for specified users? - Original Message - From: "Jesse Angell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 6:28 PM Subject: Shell Scripting > I need t

Re: shell scripting and command expr

2002-04-08 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sun, 7 Apr 2002, vincent li wrote: >i need to write a short shell script to get the >available memory percentage,for example: if i get >available memory 2033680, and total memory 2555848, >how could i change these two data into percentage? > >if

Re: shell scripting and command expr

2002-04-07 Thread Cameron Simpson
On 22:55 07 Apr 2002, vincent li <[EMAIL PROTECTED]> wrote: | i need to write a short shell script to get the | available memory percentage,for example: if i get | available memory 2033680, and total memory 2555848, | how could i change these two data into percentage? | | if i excute `expr 2033

Re: Shell scripting..

2001-11-24 Thread Duncan Hill
On Sat, 24 Nov 2001, rpjday wrote: > i wandered into this late, so i apologize if i misunderstand the > question. but did you try using a shell function instead of a shell > script? since functions are run at the current shell level, doing > something like a "cd" inside a function really will "

Re: Shell scripting..

2001-11-24 Thread Duncan Hill
On Fri, 23 Nov 2001, Anthony E. Greene wrote: > >type of problem (or is it a 'you thick twit, that's how it works!'?), I > >would appreciate it. > > You have to source the script into your current shell. If you run it > normally (as a subshell) it returns you to your current shell when it's > d

Re: Shell scripting..

2001-11-23 Thread Rodolfo J. Paiz
At 11/23/2001 10:29 AM -0500, you wrote: >However, if I write this in bash, the cd works, and then the script returns >me to where I was! Anyone got a pointer on where I can look to solve this >type of problem (or is it a 'you thick twit, that's how it works!'?), I >would appreciate it. Script r

Re: Shell Scripting

2000-12-11 Thread Harry Putnam
"Tomer Okavi" <[EMAIL PROTECTED]> writes: > Hey guys. > > Where can find docs howto's anything on > shell scripting? You may have these two on board: HOWTO: Adv-Bash-Scr-HOWTO and typing `info bash' at a prompt should bring up the bash manual in the info reader If you don't have HOWTOS on

RE: Shell Scripting

2000-12-11 Thread Ning Zhu
comp.unix.shell -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tomer Okavi Sent: Monday, December 11, 2000 4:37 PM To: Redhat-List@Redhat. Com Subject: Shell Scripting Hey guys. Where can find docs howto's anything on shell scripting? Thanks Tom.

Re: Shell Scripting HOWTO?

2000-09-25 Thread Ben Logan
Here are two howto's on the subject (scripting in Bash): http://www.linuxdoc.org/HOWTO/Adv-Bash-Scr-HOWTO/index.html http://www.linuxdoc.org/HOWTO/Bash-Prog-Intro-HOWTO.html Regards, Ben Logan On Sat, Sep 23, 2000 at 01:09:53AM +0530, srikrishnan wrote: > Please let me know,is any othe site whic

Re: Shell Scripting HOWTO?

2000-09-22 Thread srikrishnan
Hi Adam Sleight , I cannot view the link which you have sent. Please let me know,is any othe site which gives tutorials or details about How to Write Shell scripts. Awaiting in eger, Srikrishnan. At 10:21 AM 9/22/00 +0100, you wrote: >On Wed, Sep 13, 2000 at 12:30:53PM -0700, Adam Sleight wrot

Re: Shell Scripting HOWTO?

2000-09-22 Thread Thomas Ribbrock
On Wed, Sep 13, 2000 at 12:30:53PM -0700, Adam Sleight wrote: [...] > Tutorial on Shell Scripts > http://physics.ucsc.edu/tutor/shell.html [...] That one doesn't seem to exist anymore - I get a "Not Found". Thomas -- "Look, Ma, no obsolete quotes and plain text only!" Thomas

Re: Shell Scripting HOWTO?

2000-09-13 Thread Luke C Gavel
On Wed, 13 Sep 2000, George Lenzer wrote: > I really want to gain more knowledge on shell scripting. (I > used to be pretty good at DOS batch files in my "bad old > days" :) ) Bash blows DOS completely away [KABM *DOS drops, a shattered, tired, old hulk...*] at least when you compare the pr

Re: Shell Scripting HOWTO?

2000-09-13 Thread Adam Sleight
On Wed, 13 Sep 2000 14:14:30 -0400 "George Lenzer" <[EMAIL PROTECTED]> wrote: #I really want to gain more knowledge on shell scripting. (I used to be pretty #good at DOS batch files in my "bad old days" :) ) Does anyone have any good #resources that they are familiar with on the net? A guy na

Re: Shell Scripting HOWTO?

2000-09-13 Thread Chuck Mead
On Wed, 13 Sep 2000, George Lenzer spewed into the bitstream: GL>I've been using Linux for about three years now and haven't really GL>explored much beyond the usual bash commands: mv, ls, mkdir, export, GL>gzip, dd, cat, etc... GL> GL>I really want to gain more knowledge on shell scripting. (I

Re: Shell Scripting HOWTO?

2000-09-13 Thread rpjday
On Wed, 13 Sep 2000, George Lenzer wrote: > I've been using Linux for about three years now and haven't really explored much >beyond the usual bash commands: > mv, ls, mkdir, export, gzip, dd, cat, etc... > > I really want to gain more knowledge on shell scripting. (I used to be pretty good >

Re: Shell Scripting ?

2000-07-24 Thread Cameron Simpson
On Tue, Jul 18, 2000 at 02:22:09PM -0500, Bret Hughes wrote: | > kernel-2.2.14-12.i386.rpm | > kernel-2.2.14-6.0.1.i386.rpm | > kernel-2.2.14-6.1.1.i386.rpm | > How do I get a list of only the newest version of each package | > listed. | What does ls -t do? It should sort by modification time of

Re: Shell Scripting ?

2000-07-18 Thread Bret Hughes
[EMAIL PROTECTED] wrote: > I am trying to combine a few commands to download and update > rpm packages automatically. Now, I know I can use autorpm and > a few other packages to do this, but I would like to use this > as a learning opportunity. > > So far I am using wget to get the list of update

Re: shell scripting

2000-06-30 Thread Todd A. Jacobs
On Fri, 30 Jun 2000 [EMAIL PROTECTED] wrote: > I'm trying to find a way to write a short bash shell script that can > determing my current dynamic IP address as assigned by my ISP and save > it as a shell variable, then write it to a file with other data all on > one line. Any ideas? Sure. Run a

Re: Shell scripting help.

1998-05-06 Thread Chris Bond
On Tue, 5 May 1998, Jason wrote: > > I'm trying to write a shell script that will automatically let me modify > the mail settings for sendmail.cf without having to go into the file and > do it. What details are you exactly modififing in sendmail.cf? You will probably find there is a lot nicer

Re: Shell scripting help.

1998-05-06 Thread Iztok Polanic
Hello !!! [snip] -e Enable interpretation of the following backslash- escaped characters in the strings: \a alert (bell) \b backspace \c suppress trailing newline \f form feed \n n

Re: Shell scripting help.

1998-05-05 Thread Fred Smith
On Tue, May 05, 1998 at 02:43:16PM -0400, Jason wrote: > > I'm trying to write a shell script that will automatically let me modify > the mail settings for sendmail.cf without having to go into the file and > do it. > > I need a way to force it to echo a "tab" command, but I can't seem to find >

Re: Shell scripting help.

1998-05-05 Thread Jason
I got several replies, and thanks everyone !:) Are there any other \ functions I should know about? I already use \ to 'ignore' certain characters @'s and such.. any other useful ones? :) Thanks again, /j On Tue, 5 May 1998, Chris Tyler wrote: > Jason <[EMAIL PROTECTED]> wrote: > > > > I'm tr

Re: Shell scripting help.

1998-05-05 Thread dkc
Hey, Try this: ---cut here #!/bin/sh echo "hello\c" echo "\t\c" echo "there" echo "\n" ---cut here The \t echoes a tab character; the \c supresses the newline that would otherwise be added. Hope that helps... Dek

Re: Shell scripting help.

1998-05-05 Thread Chris Tyler
Jason <[EMAIL PROTECTED]> wrote: > > I'm trying to write a shell script that will automatically let me modify > the mail settings for sendmail.cf without having to go into the file and > do it. > > I need a way to force it to echo a "tab" command, but I can't seem to find > a way to do that. I got