BASH Shell Scripting Question

2003-06-27 Thread Richard Crawford
Greetings, I have a shell script which duplicates a file and then renames the duplicate file; the trick is that the duplicate file needs to have the same permissions as the original file. For example: 1. Open file A.txt 2. Manipulate A.txt 3. Save A.txt as A.txt.tmp 4. Rename A.txt.tmp

Re: BASH Shell Scripting Question

2003-06-27 Thread Bret Hughes
On Fri, 2003-06-27 at 11:43, Richard Crawford wrote: Greetings, I have a shell script which duplicates a file and then renames the duplicate file; the trick is that the duplicate file needs to have the same permissions as the original file. For example: 1. Open file A.txt 2.

Re: BASH Shell Scripting Question

2003-06-27 Thread Gordon Messmer
Richard Crawford wrote: ... 5. Give B.txt the same permissions as A.txt I assume that there is some set of variables I can look at to find various attributes of A.txt, so that $APerm = permissions(A.txt) or something, so I can do chmod $APerm B.txt in step 5. From the setfacl man page:

Re: BASH Shell Scripting Question

2003-06-27 Thread pnelson
On Fri, 2003-06-27 at 09:43, Richard Crawford wrote: Greetings, I have a shell script which duplicates a file and then renames the duplicate file; the trick is that the duplicate file needs to have the same permissions as the original file. For example: 1. Open file A.txt 2.

Re: BASH Shell Scripting Question

2003-06-27 Thread Richard Crawford
Thanks to everyone who replied to this question. I wound up doing it in Perl. ;-) Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye.

Re: Shell Scripting Question

2003-06-24 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 question,

bsed (was: Re: Shell Scripting Question)

2003-06-24 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: 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 just

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 .html

Shell scripting issue resolved!!

2003-06-24 Thread Richard Crawford
Once I got out of the mindset of having to use a bash shell script for the task (thanks to a couple of people of this list for the suggestion), I came up with this script that does the trick (specific IP address and directory structure stuff changed to protect the innocent): #!/usr/local/bin/perl

Shell Scripting Question

2003-06-23 Thread Richard Crawford
I have an urgent need inside a shell script to replace a filename within an html file with the absolute url to the file. For example, http://www.thesite.com/theform.html calls a CGI script. The FORM tag looks like this: form name=thisForm method=post action=myScript.pl What I need to do is

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.thesite.com/mySc

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 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 starting

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 starting

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 your

Re: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-04 Thread Mertens Bram
I'm just learning how to write shell scripts, and I'd like to find example scripts to look at. The BASH howto and Advanced BASH howto isn't too great in this respect. Take a look at http://www.linuxcommand.org/. William Shotts, Jr. has put together a very nice tutorial and the site also

Re: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-04 Thread Mertens Bram
I'm just learning how to write shell scripts, and I'd like to find example scripts to look at. The BASH howto and Advanced BASH howto isn't too great in this respect. Take a look at http://www.linuxcommand.org/. William Shotts, Jr. has put together a very nice tutorial and the site also

Re: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-03 Thread Anthony E. Greene
On 02-Feb-2003/00:51 +, RD Egeland [EMAIL PROTECTED] wrote: I'm just learning how to write shell scripts, and I'd like to find example scripts to look at. The BASH howto and Advanced BASH howto isn't too great in this respect. The immediate task I'm trying to do is extract a date into a

RE: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-03 Thread Hugh E Cruickshank
Hi Ryan: Here are those promised links: Bash specific: http://unix.about.com/cs/shellsbash/ http://users.info.unicaen.fr/~jacques/NAPI/unite-A1/Adv-Bash-Scr-HOWTO/ http://www.gnu.org/manual/bash-2.05a/html_node/bashref.html http://bashdb.sourceforge.net/

Re: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-02 Thread Caleb Groom
On Sat, 2003-02-01 at 18:51, RD Egeland wrote: I'm just learning how to write shell scripts, and I'd like to find example scripts to look at. The BASH howto and Advanced BASH howto isn't too great in this respect. The immediate task I'm trying to do is extract a date into a standardized

Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-01 Thread RD Egeland
I'm just learning how to write shell scripts, and I'd like to find example scripts to look at. The BASH howto and Advanced BASH howto isn't too great in this respect. The immediate task I'm trying to do is extract a date into a standardized format which I can then somehow sort. The text I

RE: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-01 Thread Hugh E Cruickshank
Hi Ryan: I believe I have some link at the office. I will try and remember to forward them to you on Monday. In the interim, take a look at the awk command. This will allow you to reformat the input lines (as well as many other things). For a start the command: awk '{print $10 $7 $8

Re: Good Script Repository Somewhere? Help with Shell Scripting.

2003-02-01 Thread Raymundo Vega
small corrections, the symbol is not needed, awk can read directly from a file too. if you want to sort it, it is easier if month is converted to its numeric equivalent1 to 12 and print a string like: mmddhhmmss the following script does that on a test string. hope it helps raymundo

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 ] then

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, 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 ... done

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 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
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 from a

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 exactly for scripting

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-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

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 a

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'm trying

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 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. +

Shell Scripting (IF within FOR?)

2002-12-13 Thread Ashley M. Kirchner
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 a backup script, using cp/rsync). First, the script

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. -

RE: Shell scripting help

2002-12-03 Thread Ziad Samaha
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 ([65.54.253.137]) by mc8-s7.law1.hotmail.com with Microsoft SMTPSVC

Shell scripting help

2002-12-01 Thread Mikevl
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 userfile name:password:detail:UID name:password:detail:UID name:password:detail:UID name:password:detail:UID

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 help

2002-12-01 Thread Mikevl
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 script Command is useradd userfile

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 $NAME='cut -d : -f1'

Shell scripting help

2002-12-01 Thread Mikevl
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Robert P. J. Day Sent: Monday, 2 December 2002 07:08 To: [EMAIL PROTECTED] Subject: Re: Shell scripting help On Sun, 1 Dec 2002, Bill Horne wrote: - Original Message - From: Mikevl [EMAIL PROTECTED] Hi Can anybody

RE: Shell scripting help

2002-12-01 Thread Adam H. Pendleton
error message. ahp -Original Message- From: Mikevl [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 01, 2002 13:52 To: Redhat-List (E-mail) Subject: Shell scripting help *This message was transferred with a trial version of CommuniGate(tm) Pro* *This message was transferred

RE: Shell scripting help

2002-12-01 Thread Mikevl
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 *This message

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 : -f1

Re: Bash Shell Scripting Question

2002-10-28 Thread Todd A. Jacobs
On Sat, 26 Oct 2002, MET wrote: if[ $MANPATH ] ; then It's telling you it can't tokenize the expressions, right? Spacing and quoting are not optional for this construct. And where is the test condition? How about changing all your tests to something like: if [ -n $MANPATH ]; then

Bash Shell Scripting Question

2002-10-26 Thread MET
I'm trying to start using Qt and I'm having problems setting up the environmental variables so I guess I'm off to a pretty bad start. Below is what I have included in my /etc/profile minus the defaults and the export commands. My export commands are fine as the rest of my variables work except

Re: Bash Shell Scripting Question

2002-10-26 Thread Michael Schwendt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sat, 26 Oct 2002 16:42:34 -0400, MET wrote: I'm trying to start using Qt and I'm having problems setting up the environmental variables so I guess I'm off to a pretty bad start. Below is what I have included in my /etc/profile minus the

Re: [REDHAT] Re: [REDHAT] Shell Scripting

2002-06-13 Thread David Kramer
On Tue, 11 Jun 2002, Paul Branston wrote: On Mon, Jun 10, 2002 at 09:42:56PM -0400, David Kramer wrote: sed -e '/VirtualHost \*/,/\/VirtualHost/d' /www/conf/httpd.conf /www/conf/httpd.conf Hi David, Did you test this ?? I can tell you from bitter experience that you need an

Re: [REDHAT] Re: [REDHAT] Re: [REDHAT] Shell Scripting

2002-06-13 Thread David Kramer
10, 2002 11:55 PM Subject: [REDHAT] Re: [REDHAT] Re: [REDHAT] Shell Scripting On Mon, 10 Jun 2002, Jesse Angell wrote: That doesnt look right.. There are many users. I want to delete just that one users OK, you could have been more specific. Never fear. perl -e ' while

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 about

RE: Shell Scripting

2002-06-11 Thread Stephen_Reilly
sed /'\VirtualHost *\'/,/'\VirtualHost\'/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

Re: [REDHAT] Shell Scripting

2002-06-11 Thread Paul Branston
On Mon, Jun 10, 2002 at 09:42:56PM -0400, David Kramer wrote: sed -e '/VirtualHost \*/,/\/VirtualHost/d' /www/conf/httpd.conf /www/conf/httpd.conf Hi David, Did you test this ?? I can tell you from bitter experience that you need an intermediate file, using sed to read from some file and

Shell Scripting

2002-06-10 Thread Jesse Angell
I need to have a script open the file /www/conf/httpd.conf VirtualHost * DocumentRoot /var/www/virtual/$user/html Servername $user.palaceunlimited.com ErrorLog /var/www/virtual/$user/logs/error_log CustomLog /var/www/virtual/$user/logs/access_log combined /VirtualHost and then delete all of that.

Re: Shell Scripting

2002-06-10 Thread daniel
what exactly do you want to delete? everything between virtualhost * and /virtualhost 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

Re: [REDHAT] Shell Scripting

2002-06-10 Thread David Kramer
On Mon, 10 Jun 2002, Jesse Angell wrote: I need to have a script open the file /www/conf/httpd.conf VirtualHost * DocumentRoot /var/www/virtual/$user/html Servername $user.palaceunlimited.com ErrorLog /var/www/virtual/$user/logs/error_log CustomLog /var/www/virtual/$user/logs/access_log

Re: [REDHAT] Shell Scripting

2002-06-10 Thread Jesse Angell
That doesnt look right.. There are many users. I want to delete just that one users - Original Message - From: David Kramer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 10, 2002 8:42 PM Subject: Re: [REDHAT] Shell Scripting On Mon, 10 Jun 2002, Jesse Angell wrote: I

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 virtualhost * and /virtualhost or all of your

Re: [REDHAT] Re: [REDHAT] Shell Scripting

2002-06-10 Thread David Kramer
On Mon, 10 Jun 2002, Jesse Angell wrote: That doesnt look right.. There are many users. I want to delete just that one users OK, you could have been more specific. Never fear. perl -e ' while() { $Line .= $_ } $Line =~ s!VirtualHost.*'${user}'.*?\/VirtualHost!!s; print $Line; '

Re: [REDHAT] Re: [REDHAT] Shell Scripting

2002-06-10 Thread Jesse Angell
where do you put the filename in that script - Original Message - From: David Kramer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 10, 2002 11:55 PM Subject: Re: [REDHAT] Re: [REDHAT] Shell Scripting On Mon, 10 Jun 2002, Jesse Angell wrote: That doesnt look right

Re: shell scripting and command expr

2002-04-08 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

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 i

shell scripting and command expr

2002-04-07 Thread vincent li
Hi, all 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 2033680 / 2555848` ,result is 0, pls tell me how to get the

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 done.

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 cd you

Shell scripting..

2001-11-23 Thread Duncan Hill
I tend to write all of my shell scripts in bash - I like the power and flexibility. Unfortunately, the environment in which I need to write my next script is tcsh. Fine, I can learn tcsh if I have to, but perusing the manual and some web pages, I really don't like the look of tcsh. The

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 runs

Shell Scripting

2000-12-11 Thread Tomer Okavi
Hey guys. Where can find docs howto's anything on shell scripting? Thanks Tom. ___ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list

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

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 HOWT

Re: Simple Shell Scripting Question

2000-10-15 Thread Nic Steussy
awk '{print $2}'`" fi echo "He's dead Jim, He's dead." --- - Original Message - From: "Kevin Diffily" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, October 14, 2000 8:24 PM Subject: Simple Shell Scripting Question I hav

Simple Shell Scripting Question

2000-10-14 Thread Kevin Diffily
I have been unable to create a simple program that will kill a running ppp connection. I have tried cat /var/run/ppp0|kill echo /var/run/ppp0|kill killcat /var/run/ppp0 etc. Any help will be appreciated. "The

Re: Simple Shell Scripting Question

2000-10-14 Thread Mike Burger
How about "killall -9 ppp On Sat, 14 Oct 2000, Kevin Diffily wrote: I have been unable to create a simple program that will kill a running ppp connection. I have tried cat /var/run/ppp0|kill echo /var/run/ppp0|kill killcat /var/run/ppp0 etc. Any help will be appreciated.

RE: Simple Shell Scripting Question

2000-10-14 Thread Uncle Meat
On 15-Oct-2000 Kevin Diffily spoke something to the effect: I have been unable to create a simple program that will kill a running ppp connection. I have tried cat /var/run/ppp0|kill echo /var/run/ppp0|kill killcat /var/run/ppp0 etc. Any help will be appreciated. Here's one that

RE: Simple Shell Scripting Question

2000-10-14 Thread David Kramer
Uncle Meat wrote: On 15-Oct-2000 Kevin Diffily spoke something to the effect: I have been unable to create a simple program that will kill a running ppp connection. I have tried cat /var/run/ppp0|kill echo /var/run/ppp0|kill killcat /var/run/ppp0 etc. kill `cat /var/run/ppp0`

Re: Simple Shell Scripting Question

2000-10-14 Thread Steven W. Orr
Someone suggested that you use killall, but I don't think that really answers your question. -- -Time flies like the wind. Fruit flies like a banana. Stranger things have - -happened but none stranger than this. Does your driver's license say Organ -Donor?Black holes are where God divided by

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

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-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

Shell Scripting HOWTO?

2000-09-13 Thread George Lenzer
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 at DOS batch files in my "bad old days"

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 HOWTO?

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

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 the

Shell Scripting ?

2000-07-18 Thread chadws
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 updates and sed and cut to get the names

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 updates and

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 awk,

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

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 way

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 trying

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 one

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...

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 a way