RE: Shell Script Functionality

2003-08-28 Thread Bradley Caricofe
untested but should come close: find ~/.loki -name '*.dso'|xargs rm Assumption: file is run under the user's id otherwise the ~ will not substitute correctly. Bret and Sean, thanks very much! Within the .loki directory are about 20 subdirectories with these .dso files. Will this command

RE: Shell Script Functionality

2003-08-28 Thread Bret Hughes
On Wed, 2003-08-27 at 20:14, Bradley Caricofe wrote: untested but should come close: find ~/.loki -name '*.dso'|xargs rm Assumption: file is run under the user's id otherwise the ~ will not substitute correctly. Bret and Sean, thanks very much! Within the .loki directory are

RE: Shell Script Functionality

2003-08-28 Thread Bradley Caricofe
I always found man find to be hard to glean usable information from but info find does a pretty good job of explaining and gives some examples. Thanks very much! Very, very helpful... =) - Brad -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]

Re: Shell Script Functionality

2003-08-27 Thread Sean Estabrooks
On Wed, 27 Aug 2003 18:04:36 -0400 Bradley Caricofe [EMAIL PROTECTED] wrote: I have a Tribes 2 server running on my RH 7.2 system and I have a simple startup script that brings the game server up. The game creates a hidden .loki folder in my users home directory which contains all of the game

Re: Shell Script Functionality

2003-08-27 Thread Bret Hughes
On Wed, 2003-08-27 at 17:04, Bradley Caricofe wrote: I have a Tribes 2 server running on my RH 7.2 system and I have a simple startup script that brings the game server up. The game creates a hidden .loki folder in my users home directory which contains all of the game settings. Within this

RE: shell script - expert question

2003-03-17 Thread Kleiner Hampel
Thanks! Am Son, 2003-03-16 um 22.23 schrieb Robert P. J. Day: ... -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list

Re: shell script - expert question

2003-03-16 Thread Rus Foster
On Sun, 16 Mar 2003, Kleiner Hampel wrote: Hi, i have a directory with some files with spaces in the name: abc 1.mp3 abc 2.mp3 abc 3 track 2.mp3 For my shell script i have to begin so: for i in `ls`; do echo $i; done Try cd /tmp/foo for i in * ; do echo $i ; done You need the

Re: shell script - expert question

2003-03-16 Thread Kleiner Hampel
Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my directory. i tried this: for i in *; do mv $i `echo $i | sed s/abc//`; done but it doesn't do that. i always get the error, that the last arguement must be a directory! I guess, the reason are

RE: shell script - expert question

2003-03-16 Thread Cowles, Steve
-Original Message- From: Kleiner Hampel Sent: Sunday, March 16, 2003 10:41 AM Subject: Re: shell script - expert question Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my directory. i tried this: for i in *; do mv $i

Re: shell script - expert question

2003-03-16 Thread Mikkel L. Ellertson
On 16 Mar 2003, Kleiner Hampel wrote: Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my directory. i tried this: for i in *; do mv $i `echo $i | sed s/abc//`; done but it doesn't do that. i always get the error, that the last

RE: shell script - expert question

2003-03-16 Thread Robert P. J. Day
On Sun, 16 Mar 2003, Cowles, Steve wrote: -Original Message- From: Kleiner Hampel Sent: Sunday, March 16, 2003 10:41 AM Subject: Re: shell script - expert question Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my

Re: shell script - expert question

2003-03-16 Thread Kleiner Hampel
Thanks, this works! regards, hampel Am Son, 2003-03-16 um 18.23 schrieb Mikkel L. Ellertson: On 16 Mar 2003, Kleiner Hampel wrote: Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my directory. i tried this: for i in *; do mv

RE: shell script - expert question

2003-03-16 Thread Kleiner Hampel
Mar 2003, Cowles, Steve wrote: -Original Message- From: Kleiner Hampel Sent: Sunday, March 16, 2003 10:41 AM Subject: Re: shell script - expert question Hi, now it works, but because of the '*'. now i want to remove the leading abc from all files in my

RE: shell script - expert question

2003-03-16 Thread Kleiner Hampel
Hi, this results in the same error message! regards, hampel Am Son, 2003-03-16 um 18.20 schrieb Cowles, Steve: -Original Message- From: Kleiner Hampel Sent: Sunday, March 16, 2003 10:41 AM Subject: Re: shell script - expert question Hi, now it works, but because

RE: shell script - expert question

2003-03-16 Thread Robert P. J. Day
On 16 Mar 2003, Kleiner Hampel wrote: Hi, tricky! But what is about: ${var##string} ${var%string} ${var%%string} What means the double #, the single and double #? Please explain me in some words! Thanks! Is there a man page with this information? these are internal *shell*

Re: Shell Script Returned Value

2003-01-22 Thread Kevin - KD Micro Software
: Re: Shell Script Returned Value Kevin - KD Micro Software wrote: Hello everyone, I have a small programming question here, which I'm not sure if it's possible to do or not, but any suggestions would be greatly appreciated. What I need is for the following to return with the appropriate

Re: Shell Script Returned Value

2003-01-21 Thread Jan
Kevin - KD Micro Software wrote: Hello everyone, I have a small programming question here, which I'm not sure if it's possible to do or not, but any suggestions would be greatly appreciated. What I need is for the following to return with the appropriate exit status value ( $? ). Start

RE: Shell Script Returned Value

2003-01-21 Thread Dan Bar Dov
Maybe the following will work: ( tar . ; TAR_RETVAL=$? ) | while read ... the () puts the tar is a subshell, the subshell's output goes to your loop. Dan -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Kevin - KD Micro Software Sent: Monday,

Re: Shell Script Returned Value

2003-01-21 Thread Mark Lundy
The other thing you could do is tee the output to a file, then process that file. That would allow you to check return codes and also process the filenames tar spews out. Would be two separate steps and little more code! What you are doing is unusual and, interesting! OK, exactly what are

Re: Shell Script Question || Check for set variable

2002-11-06 Thread Hella
There are several options but this one will work (Assuming bash or sh): if [ $2 == ]; then Also, here is a very handy guide I use for those quick lookups when you get rusty. It is avail. in PDF and HTML. http://personal.riverusers.com/~thegrendel/abs-guide-1.6.tar.bz2 -Chuck MET wrote:

Re: Shell Script Question || Check for set variable

2002-11-05 Thread Hal Burgiss
On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote: Simply put, I'm trying to check if $2 is set. Any ideas? if ( ! $2 ) then echo You must set a second file exit 1 fi The above doesn't work reporting if expression error. Any help would be

Re: Shell Script Question || Check for set variable

2002-11-05 Thread David Kramer
On Tuesday 05 November 2002 06:54 pm, Hal Burgiss wrote: On Tue, Nov 05, 2002 at 06:46:29PM -0500, MET wrote: Simply put, I'm trying to check if $2 is set. Any ideas? if ( ! $2 ) then echo You must set a second file exit 1 fi The above doesn't work

Re: Shell Script Question || Check for set variable

2002-11-05 Thread Todd A. Jacobs
On Tue, 5 Nov 2002, MET wrote: if ( ! $2 ) then echo You must set a second file exit 1 fi Start by reading the bash manual at: http://www.gnu.org/manual/bash-2.05a/bashref.html But you can do a test expression like: if [[ -z $2 ]];

Re: Shell Script Question || Check for set variable

2002-11-05 Thread MET
I've tried what follows and I still get if: Expression Syntax . #!/bin/tcsh if [ -z $2 ] ; then echo You have not set a file to be appended. exit 1 fi Any ideas? ~ MET On Tuesday 05 November 2002 7:35 pm, Todd A. Jacobs wrote:

RE: Shell Script Question || Check for set variable

2002-11-05 Thread Cowles, Steve
-Original Message- From: MET Subject: Re: Shell Script Question || Check for set variable I've tried what follows and I still get if: Expression Syntax . #!/bin/tcsh if [ -z $2 ] ; then echo You have not set a file to be appended

RE: Shell Script Question || Check for set variable

2002-11-05 Thread MET
Thanks a lot that worked =) ~ Matthew -Original Message- From: [EMAIL PROTECTED] [mailto:redhat-list-admin;redhat.com] On Behalf Of Cowles, Steve Sent: Tuesday, November 05, 2002 10:49 PM To: '[EMAIL PROTECTED]' Subject: RE: Shell Script Question || Check for set variable

Re: shell script

2002-09-12 Thread Todd A. Jacobs
On Tue, 10 Sep 2002, Steven W. Orr wrote: tty_type=$(tty) if [[ ${tty_type%/*} = /dev/pts ]] then TERM=vt100 else TERM=scoansi fi Note that this will not catch instances inside of an xterm, since xterms are assigned on a pts and not a pty. You may also want to test $SHLVL to

RE: shell script

2002-09-11 Thread David Freeman
need to assign the TERM variable depending on if user is on console TERM=scoansi, but if it's on terminal 'pts/#' then TERM=vt100.. In .bash_profile I saw this. if tty-type in 'tty[1,2,#]' ; then TERM=scoansi else TERM=vt100 fi Did you 'EXPORT TERM'? AFAIK you need to do

Re: shell script

2002-09-10 Thread Steven W. Orr
On Tue, 10 Sep 2002, alexis Vasquez wrote: =need to assign the TERM variable depending on if user =is on console TERM=scoansi, but if it's on terminal ='pts/#' then TERM=vt100.. =In .bash_profile I saw this. = =if [ -f ~/.bashrc ]; then =. ~/.bashrc =fi = =so I did =get the value for

Re: Shell Script...more

2002-07-27 Thread Robert P. J. Day
On Sat, 27 Jul 2002, Anthony E. Greene wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED] wrote: while i'm thinking about it, is there a way to get both the real and effective user names/UIDs? in case someone has sued to

Re: Shell Script...more

2002-07-27 Thread Brian Ashe
Robert P. J. Day, On Saturday July 27, 2002 05:17, you said something about: On Sat, 27 Jul 2002, Anthony E. Greene wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED] wrote: while i'm thinking about it, is there a way

Re: Shell Script...more

2002-07-27 Thread Robert P. J. Day
On Sat, 27 Jul 2002, Brian Ashe wrote: But to answer your original question... You could use the logname command to do a comparison like so... sadly, logname under limbo also seems to be broken. sigh. rday Robert P. J. Day, RHCE, RHCI Eno River Technologies, Chapel Hill NC Unix, Linux

Re: Shell Script...more

2002-07-27 Thread C. Linus Hicks
On Sat, 2002-07-27 at 11:15, Brian Ashe wrote: Robert P. J. Day, On Saturday July 27, 2002 05:17, you said something about: On Sat, 27 Jul 2002, Anthony E. Greene wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED]

Re: Shell Script...more

2002-07-27 Thread Todd A. Jacobs
On Sat, 27 Jul 2002, Robert P. J. Day wrote: id: cannot print only names or real IDs in default format () id -run id -ur -- The only thing that helps me maintain my slender grip on reality is the friendship I share with my collection of singing potatoes. -

RE: Shell Script...more

2002-07-26 Thread Stephen_Reilly
use whoami or more specifically VarName=`whoami` steve -Original Message- From: Matthew Melvin [mailto:[EMAIL PROTECTED]] Sent: 26 July 2002 03:35 To: [EMAIL PROTECTED] Subject: Re: Shell Script...more On Thu, 25 Jul 2002 at 9:17pm (-0500), Jesse Angell wrote: Hey, I

RE: Shell Script...more

2002-07-26 Thread Todd A. Jacobs
On Fri, 26 Jul 2002, Robert P. J. Day wrote: while i'm thinking about it, is there a way to get both the real and effective user names/UIDs? in case someone id -r -- The only thing that helps me maintain my slender grip on reality is the friendship I share with my collection of singing

Re: Shell Script...more

2002-07-26 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 26-Jul-2002/05:50 -0400, Robert P. J. Day [EMAIL PROTECTED] wrote: while i'm thinking about it, is there a way to get both the real and effective user names/UIDs? in case someone has sued to root, is there a way to see the original login name?

Re: Shell Script

2002-07-25 Thread Robert P. J. Day
On Thu, 25 Jul 2002, Jesse Angell wrote: I need to make a shell script to look in /home/$user/palaceserver/palace/psdata/backup and in that folder delete all the files that are 7 day's old.. Could someone help me out with this? $ man tmpwatch rday

Re: Shell Script

2002-07-25 Thread Jesse Angell
That tmpwatch that Robert suggested worked great.. I'll stick with that. - Original Message - From: Randy Weidman [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Sent: Thursday, July 25, 2002 8:19 PM Subject: Re: Shell Script I think this will do what you need find /home

Re: [REDHAT] Re: Shell Script

2002-06-22 Thread David Kramer
On Fri, 21 Jun 2002, Jesse Angell wrote: I couldn't get them to work I emailed asking more about it, never a reply.. I remember a post asking how you specify the input and output files, which I answered. If you're referring to a different question I must have missed it. Please repost your

RE: Shell Script

2002-06-21 Thread Stephen_Reilly
sed '/VirtualHost/,/VirtualHost/d' /www/conf/httpd.conf steve -Original Message- From: Jesse Angell [mailto:[EMAIL PROTECTED]] Sent: 21 June 2002 02:49 To: [EMAIL PROTECTED] Subject: Shell Script Hello, I need to write a shell script to do the following edit the

Re: Shell Script

2002-06-21 Thread David Kramer
On Thu, 20 Jun 2002, Jesse Angell wrote: Hello, I need to write a shell script to do the following edit the /www/conf/httpd.conf file and search for the VirtualHost * DocumentRoot /var/www/virtual/$user/html Servername $user.palaceunlimited.com ErrorLog

Re: Shell Script

2002-06-21 Thread Jesse Angell
I couldn't get them to work I emailed asking more about it, never a reply.. - Original Message - From: David Kramer [EMAIL PROTECTED] To: [EMAIL PROTECTED] [EMAIL PROTECTED] Sent: Friday, June 21, 2002 4:29 PM Subject: Re: Shell Script On Thu, 20 Jun 2002, Jesse Angell wrote: Hello

Re: Shell Script

2002-06-20 Thread Jonathan Bartlett
Learn Perl and Regular Expressions :) It's in the Programming Perl book (aka the camel book). Essentially, it would look like #!/usr/bin/perl ###READ THE FILE### open(THEFILE, httpd.conf); undef $/; #This makes the following read read in the whole file instead #of one line

Re: Shell Script (fwd)

2002-06-20 Thread Jonathan Bartlett
Dangit!! Just after posting, I noticed that I got the substitution wrong. THIS $httpdconf =~ s!VirtualHost\s+\*\s+DocumentRoot\s+/var/www/virtual/$ARGV[1]/html.*?/virtualhost!!; should be changed to THIS $httpdconf =~

Re: Shell Script

2002-06-20 Thread whitroth
Date: Thu, 20 Jun 2002 20:48:31 -0500 From: Jesse Angell [EMAIL PROTECTED] I need to write a shell script to do the following edit the /www/conf/httpd.conf file and search for the VirtualHost * DocumentRoot /var/www/virtual/$user/html Servername $user.palaceunlimited.com ErrorLog

RE: shell script

2000-11-22 Thread Ning Zhu
]On Behalf Of [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 6:20 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: shell script On Tue, Nov 21, 2000 at 03:12:57PM +0800, Corisen wrote: thank you. any recommendation on books or website for a newbie to start shell scripting? Can't

Re: shell script

2000-11-21 Thread James Montz
O'Reilly - Learning the Bash Shell Addison Wesley - Linux Unix Shell Programming - Original Message - From: Corisen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 1:12 AM Subject: Re: shell script thank you. any recommendation on books

Re: shell script

2000-11-21 Thread Todd A. Jacobs
On Tue, 21 Nov 2000, Corisen wrote: pls advise how i can pass the result of "/home/userabe" to "rm -f -r" to delete the directory? You don't want to do it this way. Use 'xargs userdel -r' instead, which will remove both the account and the home directory for you. Check the man pages for both

Re: shell script

2000-11-21 Thread redhat
On Tue, Nov 21, 2000 at 03:12:57PM +0800, Corisen wrote: thank you. any recommendation on books or website for a newbie to start shell scripting? Can't tell about shellscript, but have a look at this website zeus.eed.usv.ro/misc/doc/prog/index.htm I would also like to know if you find a

Re: shell script

2000-11-21 Thread Vineeta
] Sent: Tuesday, November 21, 2000 3:08 PM Subject: Re: shell script VARIABLE=`grep .` Take care of the quotes.. its the one present before "1" on an English keyboard Cheers Aravind S Hi, one more question: how can i assign the result from grep or awk to a

Re: Shell script mag?

2000-11-20 Thread Todd A. Jacobs
On Sat, 18 Nov 2000, Luke C Gavel wrote: Where can I subscribe to magazines that discuss shell scripts? You can try Heiner's Shelldorado on the web, or join the bash mailing list on Moongroup.Com's website. -- Todd A. Jacobs Senior Network Consultant

Re: shell script

2000-11-20 Thread Vineeta
What is the output of /home/userabc like? Does it contain sub-directories which u want to be removed? give me a sample and i'll help you out. Cheers, Vineeta Corisen wrote: i'm writing a simple shell script to automate removal of directories. i've managed to extract the user home

Re: shell script

2000-11-20 Thread Aravind Sadagopan
you can use xargs to pass the output to rm..I will be like ldapsearch uid=userabc homedirectory | grep homedirectory | awk -F= '{print $2;}| xargs rm -Rf Cheers Aravind S Vineeta wrote: What is the output of /home/userabc like? Does it contain sub-directories which u want to be removed?

Re: shell script

2000-11-20 Thread Corisen
bc? the question is really how to pipe an output from some program (like grep or awk) to be the input of "rm" command. thanks. - Original Message - From: Vineeta [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 2:13 PM Subject: Re: shell script What is

Re: shell script

2000-11-20 Thread Corisen
Hi, one more question: how can i assign the result from grep or awk to a variable in shell script? Thanks. - Original Message - From: Aravind Sadagopan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 2:36 PM Subject: Re: shell script you can use xargs to pass

Re: shell script

2000-11-20 Thread Corisen
Thanks for your guidance. The deletion script is finally working. Cheers :) - Original Message - From: Aravind Sadagopan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 2:36 PM Subject: Re: shell script you can use xargs to pass the output to rm..I

Re: shell script

2000-11-20 Thread Aravind Sadagopan
pan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 2:36 PM Subject: Re: shell script you can use xargs to pass the output to rm..I will be like ldapsearch uid=userabc homedirectory | grep homedirectory | awk -F= '{print $2;}| xargs rm -Rf Cheers Aravind S

Re: shell script

2000-11-20 Thread Corisen
thank you. any recommendation on books or website for a newbie to start shell scripting? - Original Message - From: Aravind Sadagopan [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, November 21, 2000 3:08 PM Subject: Re: shell script VARIABLE=`grep .` Take care

Re: Shell script mag?

2000-11-18 Thread Jalal Hajiqolamali
hi , i Am Not Sure , but as far as i know There Is No Magazine About Shell Scripts You Can Find A Lot Of Examples In Unix Books ... Jalal From [EMAIL PROTECTED] Sat Nov 18 15:17:40 2000 Delivered-To: [EMAIL PROTECTED] Date: Sat, 18 Nov 2000 07:57:58 -0400 (AST) From: [EMAIL PROTECTED]

Re: Shell script mag?

2000-11-18 Thread Greg Wright
*** REPLY SEPARATOR *** On 18/11/00 at 7:57 [EMAIL PROTECTED] wrote: Hi, Where can I subscribe to magazines that discuss shell scripts? Maybe you mean online...I have not checked to see if all the links are still live. http://cres20.anu.edu.au/manuals/korn_scr.html

Re: Shell script mag?

2000-11-18 Thread Luke C Gavel
WOW. That's a lot of links. I'll check them out. Thanks, L.G. On Sun, 19 Nov 2000, Greg Wright wrote: *** REPLY SEPARATOR *** On 18/11/00 at 7:57 [EMAIL PROTECTED] wrote: Hi, Where can I subscribe to magazines that discuss shell scripts? Maybe you mean

Re: Shell script mag?

2000-11-18 Thread Luke C Gavel
There is, one of my instructors from a college flashed such a mag in our faces. I never saw it since. :) Perhaps another student grabbed it, never to return it. But thank you for making me remember this; I'm now going to email him! hehehe. On Sat, 18 Nov 2000, Jalal Hajiqolamali wrote: hi

Re: Shell script mag?

2000-11-18 Thread Bret Hughes
Luke C Gavel wrote: Hi, Where can I subscribe to magazines that discuss shell scripts? Best Regards, L.G. Sysadm does some of this as well as a whole bunch more. Linux Journal not too bad either. Neither are scripting only but ususlly a perl or two:) Bret

Re: shell script to switch from pump to dhcp

2000-05-22 Thread Don Knott
On Sun, 21 May 2000, James Vellenga wrote: Hello all. I currently run rh6.2 and it uses pump to establish dhcp connections. I have a cable modem and pump does not work, however, dhcpcd works great. Unfortunatally ifup and ifdown use pump now. I am no good at writing shell scripts,

Re: shell script to switch from pump to dhcp

2000-05-21 Thread Mikkel L. Ellertson
On Sun, 21 May 2000, James Vellenga wrote: Hello all. I currently run rh6.2 and it uses pump to establish dhcp connections. I have a cable modem and pump does not work, however, dhcpcd works great. Unfortunatally ifup and ifdown use pump now. I am no good at writing shell scripts,

RE: shell script

2000-03-14 Thread Ward William E PHDN
To: [EMAIL PROTECTED] Subject: Re: shell script Rodrigo Moya wrote: I've got a text file containing the following: /dir/file1=/mnt/zip/dir/file1 /dir/dir/file2=/mnt/zip/dir/dir/file1 ... and like this with hundreds of files. What I want is to read all the file and copy the files in the first p

Re: shell script

2000-03-13 Thread David E. Lupo
At 06:21 PM 3/13/00 +0100, Rodrigo Moya wrote: Hi all! I've got a text file containing the following: /dir/file1=/mnt/zip/dir/file1 /dir/dir/file2=/mnt/zip/dir/dir/file1 ... and like this with hundreds of files. What I want is to read all the file and copy the files in the first position (to

Re: shell script

2000-03-13 Thread Anthony E. Greene
Rodrigo Moya wrote: I've got a text file containing the following: /dir/file1=/mnt/zip/dir/file1 /dir/dir/file2=/mnt/zip/dir/dir/file1 ... and like this with hundreds of files. What I want is to read all the file and copy the files in the first position (to the left of '=') to the