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 .
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
* 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
* 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
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
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
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
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
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
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.
+---
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
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
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
(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
> #
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
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
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
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
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
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)) ?
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'
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
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
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
> -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
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
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
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
> >
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
- 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
-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
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
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
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
-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
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
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 "
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
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
"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
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.
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
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
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
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
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
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
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
>
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
[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
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
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
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
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
>
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
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
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
57 matches
Mail list logo