Re: how to shutdown kde and Xserver from within a bash script

2003-06-10 Thread John Horne
On Tue, 2003-06-10 at 08:37, Randy Perkins wrote: > On Tue, 2003-06-10 at 02:09, Manuel Aróstegui Ramirez wrote: > and that will kill X > however i would like to do something cleaner, > so that i am properlys shutting down kde > Try something like '/sbin/init 3'. that will take you out of runlevel

Re: how to shutdown kde and Xserver from within a bash script

2003-06-10 Thread Randy Perkins
On Tue, 2003-06-10 at 02:09, Manuel Aróstegui Ramirez wrote: > Use ps -aux to find the PID, which is called X and > kdm, and kill them with: kill -9 PID > hello thanks for your response i have used # kill $(pidof X) and that will kill X however i would like to do something cleaner, so

Re: how to shutdown kde and Xserver from within a bash script

2003-06-10 Thread Manuel Aróstegui Ramirez
from the kde menu, > or use > . > > how can i cleanly shutdown kde and Xserver from > within a bash > script. thanks, Randy > > > -- > redhat-list mailing list > unsubscribe > mailto:[EMAIL PROTECTED] > https://www.redhat.com/mailman/l

how to shutdown kde and Xserver from within a bash script

2003-06-09 Thread Randy Perkins
hello, i need to shut down my X server before i use software suspend. i am using kde, and can "logout" from the kde menu, or use . how can i cleanly shutdown kde and Xserver from within a bash script. thanks, Randy -- redhat-list mailing list unsubscribe mai

Re: Strange Bash Script Behavior -- Doesn't Recognize $variable incd Statement

2003-04-06 Thread Todd A. Jacobs
On Thu, 3 Apr 2003, Ron Franke wrote: > I'm having a strange problem with a bash script when trying to cd with a > $variable. A simple example script follows. The issue is on the line shopt -s cdable_vars -- Guvf gntyvar jnf rapbqrq jvgu gur ebg13.fu fpevcg, ninvyn

Re: Strange Bash Script Behavior -- Doesn't Recognize $variable incd Statement

2003-04-03 Thread Ron Franke
Thanks. Bret Hughes wrote: On Thu, 2003-04-03 at 17:54, Ron Franke wrote: Hi: I'm having a strange problem with a bash script when trying to cd with a $variable. A simple example script follows. The issue is on the line with cd ${copydir}. I'm wondering if there

Re: Strange Bash Script Behavior -- Doesn't Recognize $variable incd Statement

2003-04-03 Thread Ron Franke
Thanks. [EMAIL PROTECTED] wrote: Yeah, I tried the script too and it works fine. Carlo Aureus On 3 Apr 2003, Bret Hughes wrote: On Thu, 2003-04-03 at 17:54, Ron Franke wrote: Hi: I'm having a strange problem with a bash script when trying to cd w

Re: Strange Bash Script Behavior -- Doesn't Recognize $variable incd Statement

2003-04-03 Thread chino
Yeah, I tried the script too and it works fine. Carlo Aureus On 3 Apr 2003, Bret Hughes wrote: > On Thu, 2003-04-03 at 17:54, Ron Franke wrote: > > Hi: > > > > I'm having a strange problem with a bash script when trying to cd with a > > $variable. A si

Re: Strange Bash Script Behavior -- Doesn't Recognize $variable incd Statement

2003-04-03 Thread Bret Hughes
On Thu, 2003-04-03 at 17:54, Ron Franke wrote: > Hi: > > I'm having a strange problem with a bash script when trying to cd with a > $variable. A simple example script follows. The issue is on the line > with cd ${copydir}. I'm wondering if there is a bash issue or somet

RE: Strange Bash Script Behavior -- Doesn't Recognize $variable in cd Statement

2003-04-03 Thread Taylor, Bryant
To: [EMAIL PROTECTED] Subject: Strange Bash Script Behavior -- Doesn't Recognize $variable in cd Statement Hi: I'm having a strange problem with a bash script when trying to cd with a $variable. A simple example script follows. The issue is on the line with cd ${copydir}. I'm won

Strange Bash Script Behavior -- Doesn't Recognize $variable in cdStatement

2003-04-03 Thread Ron Franke
Hi: I'm having a strange problem with a bash script when trying to cd with a $variable. A simple example script follows. The issue is on the line with cd ${copydir}. I'm wondering if there is a bash issue or something in my environment that I'm missing. I have RedHat 8.0 and

Re: Bash script

2003-04-03 Thread Bret Hughes
On Thu, 2003-04-03 at 07:50, santosh kumar wrote: > Hi guys, > > Have small doubt in bash scripting..(#!/bin/bash) > Need to write script to get all m/c info, If I do cat /proc/cpuinfo will > display CPU info. > My requirement is grep CPU model, speed and display the outputs like > For example m/c

Re: Bash script

2003-04-03 Thread Emmanuel Seyman
On Thu, Apr 03, 2003 at 10:57:31AM -0300, Rodrigo Nascimento wrote: > > What you want? I believe that the poster wants our advice on how to obtain the output he posted. [EMAIL PROTECTED] seyman]$ cat /proc/cpuinfo | grep -E "MHz|name" model name : Pentium III (Coppermine) cpu MHz :

Re: Bash script

2003-04-03 Thread Rodrigo Nascimento
Hi, I didn't understand. What is wrong or confused in output for more one CPU? 1st CPU model : pentium III 1st CPU speed : 1.73 GHz 2nd CPU model : pentium IV 2nd CPU speed : 2.4 GHz The 1st CPU is a PIII with 1.7 Ghz and 2nd CPU is a P4 with 2.4 Ghz. What you want? --- santosh kumar <[E

Bash script

2003-04-03 Thread santosh kumar
Hi guys, Have small doubt in bash scripting..(#!/bin/bash) Need to write script to get all m/c info, If I do cat /proc/cpuinfo will display CPU info. My requirement is grep CPU model, speed and display the outputs like For example m/c has single CPU CPU model : pentium III CPU speed : 1.73 GHz I

Re: Bash script .bash_logout

2003-03-20 Thread Todd A. Jacobs
On 19 Mar 2003, will wrote: > The .bash_logout script is not executing when my system is in run level If your xterm is not defined as a login shell, it won't execute .bashrc or .bash_profile, either. You may need to define the xterm as a login shell to get .bash_logout working. -- Guvf gntyva

Re: Bash script .bash_logout

2003-03-19 Thread will
TERM=xterm COLORTERM=gnome-terminal BTW -- I've read the man on xdm that recommends using the Xreset script (e.g., xdm-config: DisplayManager._0.reset=/etc/X11/xdm/TakeConsole) to run after the users session is terminated. It should contain commands such as unmounting directories from file servers

Re: Bash script .bash_logout

2003-03-19 Thread Ritesh Raj Sarraf
what terminal do you use on your X Window.. Quoting will <[EMAIL PROTECTED]>: > The .bash_logout script is not executing when my system is in run level > init 5 (Xsession); however, in init 3 it runs fine. Any one know how > this can be fixed? > > Red Hat Linux release 8.0 (Psyche) -- X

Bash script .bash_logout

2003-03-19 Thread will
The .bash_logout script is not executing when my system is in run level init 5 (Xsession); however, in init 3 it runs fine. Any one know how this can be fixed? Red Hat Linux release 8.0 (Psyche) -- X window manager is Bluecurve/GNOME if it matters. -- redhat-list mailing list unsubscribe mailt

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
= hope it helps raymundo Ryan Babchishin wrote: [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 scri

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 apreci

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 apreci

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_a

Re: Bash Script question

2003-01-10 Thread Robert P. J. Day
On Thu, 9 Jan 2003, David Busby wrote: > List, > I've got a bash script, that executes other scripts (wow!) and the sub > scripts return a value. > How can I get the parent script to capture that return value? I've been all > over the BASH manual (more than one h

Re: Bash Script question

2003-01-09 Thread Ashley M. Kirchner
David Busby wrote: Here's the BASH code that I currently have #!/bin/bash for YEAR in 2003 2004 2005 2006 do CMD="./import.php $YEAR" $CMD done #!/bin/bash for YEAR in $(seq 2003 1 2006) do ./import.php $YEAR RETVAL=$? echo $RETVAL; done You can create different RETVALs if you

Re: Bash Script question

2003-01-09 Thread David Busby
to the number of items it imported. I would like BASH to trap this value and at the end echo the total of the 4 script executions. /B - Original Message - From: "Todd A. Jacobs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 19:39 Subject:

Re: Bash Script question

2003-01-09 Thread Todd A. Jacobs
On Thu, 9 Jan 2003, David Busby wrote: > How can I get the parent script to capture that return value? I've been > all over the BASH manual (more than one hour) and Google, still no luck. Not sure what you're really trying to do. If you posted real code, that would help. The exit status of th

Bash Script question

2003-01-09 Thread David Busby
List, I've got a bash script, that executes other scripts (wow!) and the sub scripts return a value. How can I get the parent script to capture that return value? I've been all over the BASH manual (more than one hour) and Google, still no luck. What I've tried (I can

Re: curious about bash script invocation variations

2002-12-20 Thread Cameron Simpson
On 07:42 20 Dec 2002, Robert P. J. Day <[EMAIL PROTECTED]> wrote: | from the man page for bash, when you run a script normally, | it runs as a non-login, non-interactive script. but with | one or more options, you can run it as a login script, an | interactive script, or both (options being some

Re: curious about bash script invocation variations

2002-12-20 Thread Bret Hughes
On Fri, 2002-12-20 at 06:42, Robert P. J. Day wrote: > > after looking a bit more at the different ways to invoke > a bash shell script, i'm curious about whether there are > legitimate applications for the "non-standard" ways. > > from the man page for bash, when you run a script normally, >

curious about bash script invocation variations

2002-12-20 Thread Robert P. J. Day
after looking a bit more at the different ways to invoke a bash shell script, i'm curious about whether there are legitimate applications for the "non-standard" ways. from the man page for bash, when you run a script normally, it runs as a non-login, non-interactive script. but with one or m

Re: minor bash script issue

2002-12-12 Thread Hasan Ümit Ezerçe
i remember some scripts that test variables by the following way: if [ "X$1" == "X" ] obviously if $1 is null then the statement is true X==X, and if the variable not null, the statement is false, so if [ "X$1" == "X" ] then echo "arg is null" else echo "arg is $1" fi will work. dbrett wro

Re: minor bash script issue

2002-12-11 Thread dbrett
Thanks to everybody for your help and explainations. I ended up with what I needed and an explaination of how somethings work. I also have a direction on where to learn more thanks again david On Wed, 11 Dec 2002, Robert P. J. Day wrote: > On Wed, 11 Dec 2002, dbrett wrote: > > > Now I am rea

Re: minor bash script issue

2002-12-11 Thread Robert P. J. Day
On Wed, 11 Dec 2002, dbrett wrote: > Now I am really confused! > > This works: > #!/bin/bash > > if [ -z $1 ]; then > echo '' > echo "format is $0 'math equation'" > echo "i.e. $0 (2+2)*3" > echo '' > exit > fi > > echo $1 | /usr/bin/bc -l assuming that

Re: minor bash script issue

2002-12-11 Thread Robert P. J. Day
On Wed, 11 Dec 2002, dbrett wrote: > Nope, unless I missed what you trying to get at. > > #!/bin/bash > > if [$1 == '']; then > echo '' > echo "format is $0 'math equation'" > echo "i.e. $0 (2+2)*3" > echo '' > exit > fi > > echo $1 | /usr/bin/bc -l 2>&1

RE: minor bash script issue

2002-12-11 Thread dbrett
; To: Robert P. J. Day > > Cc: [EMAIL PROTECTED] > > Subject: Re: minor bash script issue > > > > > > I though your correction would work, but the output still gives me the > > error message. I would really like to fix it, but will settle for not > > s

Re: minor bash script issue

2002-12-11 Thread Robert P. J. Day
On 11 Dec 2002, Bret Hughes wrote: > format is ./bc.test.sh 'math equation' > i.e. ./bc.test.sh (2+2)*3 > > [bhughes@bretsony bhughes]$ bc.test.sh (2+2)*3 > bash: syntax error near unexpected token `(2+2)' > [bhughes@bretsony bhughes]$ > [bhughes@bretsony bhughes]$ bc.test.sh '(2+2)*3' > 12 by

Re: minor bash script issue

2002-12-11 Thread dbrett
Now I am really confused! This works: #!/bin/bash if [ -z $1 ]; then echo '' echo "format is $0 'math equation'" echo "i.e. $0 (2+2)*3" echo '' exit fi echo $1 | /usr/bin/bc -l If you notice the only change I made was go with the better test for a blank v

RE: minor bash script issue

2002-12-11 Thread James Francis
> -Original Message- > From: dbrett [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 2:29 PM > To: Robert P. J. Day > Cc: [EMAIL PROTECTED] > Subject: Re: minor bash script issue > > > I though your correction would work, but the output still g

Re: minor bash script issue

2002-12-11 Thread dbrett
I though your correction would work, but the output still gives me the error message. I would really like to fix it, but will settle for not seeing the error. #!/bin/bash if [$1 == '']; then echo '' echo "format is $0 'math equation'" echo "i.e. $0 (2+2)*3" echo

Re: minor bash script issue

2002-12-11 Thread dbrett
Nope, unless I missed what you trying to get at. #!/bin/bash if [$1 == '']; then echo '' echo "format is $0 'math equation'" echo "i.e. $0 (2+2)*3" echo '' exit fi echo $1 | /usr/bin/bc -l 2>&1 /dev/null Here is the output ./math "2 + 3 *( 5 - 3 )" <---

Re: minor bash script issue

2002-12-11 Thread Bret Hughes
On Wed, 2002-12-11 at 12:05, dbrett wrote: > I have a bash to math calucations. It works but also complains about the > last line, even though it works. > > Any ideas how to fix the problem or at least not see the error message and > still work. > > #!/bin/bash > > if [$1 == '']; then >

Re: minor bash script issue

2002-12-11 Thread Robert P. J. Day
On Wed, 11 Dec 2002, Francisco Neira wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > dbrett wrote: > | I have a bash to math calucations. It works but also complains about the > | last line, even though it works. > | > | Any ideas how to fix the problem or at least not see the error

Re: minor bash script issue

2002-12-11 Thread Francisco Neira
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 dbrett wrote: | I have a bash to math calucations. It works but also complains about the | last line, even though it works. | | Any ideas how to fix the problem or at least not see the error message and | still work. | | #!/bin/bash | | if [$1 == ''];

minor bash script issue

2002-12-11 Thread dbrett
I have a bash to math calucations. It works but also complains about the last line, even though it works. Any ideas how to fix the problem or at least not see the error message and still work. #!/bin/bash if [$1 == '']; then echo '' echo "format is $0 'math equation'" e

Re: Bash Script || Loop Through Parameters

2002-11-06 Thread Todd A. Jacobs
On Wed, 6 Nov 2002, MET wrote: > for i in $# > do echo Loop iteration - $i > done What shell? Have you read the appropriate manual? Have you bought the appropriate O'Reilly book? Is this a homework assignment? -- "Whenever I feel blue, I start breathing again."

RE: Bash Script || Loop Through Parameters

2002-11-06 Thread Rechenberg, Andrew
raft/linux/docs/uniqlinuxfeatures/lsst/ Good luck, Andy. -Original Message- From: MET [mailto:met@;uberstats.com] Sent: Wednesday, November 06, 2002 2:07 PM To: RedHat List Subject: Bash Script || Loop Through Parameters I'm trying to loop through all the parameters given to a script

RE: Bash Script || Loop Through Parameters

2002-11-06 Thread Babu, Sreedhar (CAP, GCF, Satyam, Consultant)
Replace $# with $* in ur script.. -Original Message- From: MET [mailto:met@;uberstats.com] Sent: Wednesday, November 06, 2002 20:07 To: RedHat List Subject: Bash Script || Loop Through Parameters I'm trying to loop through all the parameters given to a script. My script is exe

Bash Script || Loop Through Parameters

2002-11-06 Thread MET
I'm trying to loop through all the parameters given to a script. My script is executed like so: ./app Matthew Timmy Daniel for i in $# do echo Loop iteration - $i done This loop just loops once and prints: Loop iteration - 3 Any ideas what I'm doing wrong? Th

Re: Bash Script Question

2002-11-06 Thread Robert P. J. Day
On Wed, 6 Nov 2002, Hella wrote: > You want to use sed and awk for a truly robust solution. a sadly-overlooked but useful text processing command is "expr". $ man expr which can do simple things like matching, extraction, length, substr and stuff like that. check it out before going on to sed,

Re: Bash Script Question

2002-11-06 Thread Hella
, 4 Nov 2002, Chad Skinner wrote: Is there a way in a bash script to trim the spaces from the front and end of a variable I have a script that contains the following variable definition BLOCKED_SERVICES="tcp,111,Sun RPC;\ udp,111,Sun RPC;\

Re: Bash Script Question

2002-11-05 Thread John H Darrah
On Mon, 4 Nov 2002, Chad Skinner wrote: > Is there a way in a bash script to trim the spaces from the front and end of > a variable > > I have a script that contains the following variable definition > > > BLOCKED_SERVICES="tcp,111,Sun RPC;\ >

RE: Bash Script Question

2002-11-05 Thread Cowles, Steve
> -Original Message- > From: mark > Subject: Re: Bash Script Question > > > For example, with a datafile, you could then say > export BLOCKED_SERVICES=`cat myblocked` but where you > need the services broken out, youi would want to use awk: > > # start o

Re: Bash Script Question

2002-11-05 Thread mark
On Tuesday 05 November 2002 09:51 am, Chad is done writ: > Is there a way in a bash script to trim the spaces from the front and > end of a variable > I have a script that contains the following variable definition > BLOCKED_SERVICES="tcp,111,Sun RPC;\ >

RE: Bash Script Question

2002-11-05 Thread mail-lists
essage- From: [EMAIL PROTECTED] [mailto:redhat-list-admin@;redhat.com]On Behalf Of Chad Skinner Sent: Monday, November 04, 2002 5:32 PM To: redhat-list Subject: Bash Script Question Is there a way in a bash script to trim the spaces from the front and end of a variable I have a scri

Re: Bash Script Question

2002-11-04 Thread Todd A. Jacobs
On Mon, 4 Nov 2002, Chad Skinner wrote: > Is there a way in a bash script to trim the spaces from the front and end of > a variable Not the way you're doing it. The easiest thing to do is to change your data representation, rather than spending a lot of time trying to strip whit

RE: Bash Script Question

2002-11-04 Thread Cowles, Steve
> -Original Message- > From: Chad Skinner > Subject: Bash Script Question > > > Is there a way in a bash script to trim the spaces from the > front and end of a variable > > I have a script that contains the following variable definition > > >

Bash Script Question

2002-11-04 Thread Chad Skinner
Is there a way in a bash script to trim the spaces from the front and end of a variable I have a script that contains the following variable definition BLOCKED_SERVICES="tcp,111,Sun RPC;\ udp,111,Sun RPC;\ tcp,443,Microso

bash script to test smtp relay

2002-10-13 Thread Freddy Chavez
gives more control, but I want to do it first en bash script just for fun :) Any suggestion? Regards, Freddy Chavez. -- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe https://listman.redhat.com/mailman/listinfo/redhat-list

Re: bash script to test smtp relay

2002-10-12 Thread jkinz
7;t work. I've read somewhere that > "telnet is not interactive so it will not work". I know Perl is much better > and gives more control, but I want to do it first en bash script just for > fun :) Any suggestion? The best tool for this type of work is "expect".

Re: Question on 'if' in bash script

2002-07-22 Thread Ken Sorensen
p [ Hope this helps, Ken > Date: Wed, 17 Jul 2002 20:19:36 -0500 (CDT) > Subject: Re: Question on 'if' in bash script > > to access a command from within shell, enclose it in ` ` > as > for files in `cat some.list` > do > blah > etc > > On Wed, 17

Re: Question on 'if' in bash script

2002-07-22 Thread Ken Sorensen
p [ Hope this helps, Ken > Date: Wed, 17 Jul 2002 20:19:36 -0500 (CDT) > Subject: Re: Question on 'if' in bash script > > to access a command from within shell, enclose it in ` ` > as > for files in `cat some.list` > do > blah > etc > > On Wed, 17 Jul 200

Re: Question on 'if' in bash script

2002-07-17 Thread Matthew Melvin
On Wed, 17 Jul 2002 at 5:38pm (-0700), David Busby wrote: > How would I construct the "if" to see if a module is loaded > > I've tried > > if [ -n "lsmod |grep $module" ] > as well as > if [ -z "lsmod |grep $module" ] > The main problem with your code is that bash doens't know the stuff in th

Re: Question on 'if' in bash script

2002-07-17 Thread Hal Burgiss
On Wed, Jul 17, 2002 at 05:38:26PM -0700, David Busby wrote: > How would I construct the "if" to see if a module is loaded > > I've tried > > if [ -n "lsmod |grep $module" ] > as well as > if [ -z "lsmod |grep $module" ] > > I can't get either to work...what am I doing wrong? lsmod |grep $modu

Question on 'if' in bash script

2002-07-17 Thread David Busby
How would I construct the "if" to see if a module is loaded I've tried if [ -n "lsmod |grep $module" ] as well as if [ -z "lsmod |grep $module" ] I can't get either to work...what am I doing wrong? /b ___ Redhat-list mailing list [EMAIL PROTECTED]

Re: Need help with a bash script - -n and -z always giving "true" ?

2002-01-24 Thread Dumas Patrice
On Wed, Jan 23, 2002 at 01:51:50PM -0600, JW wrote: > > if [ -n `mount |grep "/mnt/root/cschomeserver/e"` ] #if it's already mounted don't >mount it > > fluorite:~ # ./test.sh > ./test.sh: [: too many arguments The problem in your script is that the result of the command in backquotes is put a

Re: Need help with a bash script - -n and -z always giving "true" ?

2002-01-23 Thread Hal Burgiss
On Wed, Jan 23, 2002 at 01:51:50PM -0600, JW wrote: > > Obviously I do not understand how to properly get a yes/no value out > of the string returned from a nested command. If someone could > explain even that much I'd appreciate it. I think your syntax is squirrely. Probably don't want to be us

Need help with a bash script - -n and -z always giving "true" ?

2002-01-23 Thread JW
Hello, I'm trying to write a bash script for a back up job. Unfortunately I'm not getting anywhere. >I need to mount a file system only if the filesystem is >_not_ already mounted. > >I'm thinking of it like this: Ok, I've been reading documentation and

RE: Command-line mail syntax for bash script

2001-12-05 Thread Vinny Valdez
er 04, 2001 6:38 PM > To: [EMAIL PROTECTED] > Subject: Re: Command-line mail syntax for bash script > > > On Tue, Dec 04, 2001 at 12:47:20PM -0600, Vinny Valdez > <[EMAIL PROTECTED]> wrote: > | I have a quick question, I'm sure the answer is simple. > | > | I

Re: Command-line mail syntax for bash script

2001-12-04 Thread Cameron Simpson
On Tue, Dec 04, 2001 at 12:47:20PM -0600, Vinny Valdez <[EMAIL PROTECTED]> wrote: | I have a quick question, I'm sure the answer is simple. | | I want to do the following: | | 1. send an email to a list through a bash script (no interaction) | 2. hide the recepients (bcc) | 3.

Command-line mail syntax for bash script

2001-12-04 Thread Vinny Valdez
I have a quick question, I'm sure the answer is simple. I want to do the following: 1. send an email to a list through a bash script (no interaction) 2. hide the recepients (bcc) 3. be able to alter the from: address (or set a reply-to), to listoperator@domain instead of [EMAIL PROTECTE

Re: Compiling bash script

2001-11-23 Thread Anthony E. Greene
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, 23 Nov 2001, Enrico Payne wrote: >Hi, is it possible to compile a bash script, or encrypt it, but have it >still execute when running it form the shell? > >I have a number of scripts that I do not want people to edit, or see what

Compiling bash script

2001-11-22 Thread Enrico Payne
Hi, is it possible to compile a bash script, or encrypt it, but have it still execute when running it form the shell? I have a number of scripts that I do not want people to edit, or see what is going on inside for $$$ reasons. Any help is appreciated. Regards Enrico

Re: Help! Newbie needs help with bash script :(

2001-02-22 Thread Bret Hughes
0 more searches to perform and each one takes > between 10 and 15 mins searching over 12,000 files. This is the first bash > script I have evr written and I am sure it could be done better but it works > for me for now. What I really need is a quick and dirty way for the script > to pull t

Help! Newbie needs help with bash script :(

2001-02-22 Thread Steve Gulick
between 10 and 15 mins searching over 12,000 files. This is the first bash script I have evr written and I am sure it could be done better but it works for me for now. What I really need is a quick and dirty way for the script to pull the search words from a list so that I can go home tonight :) The

Re: bash: [: too many arguments WAS: Re: [OT] help with bash script

2001-02-15 Thread Harry Putnam
John H Darrah <[EMAIL PROTECTED]> writes: > On Thu, 15 Feb 2001, Jonathan Wilson wrote: > > > > if [ "$1" != *.src.rpm ] && [ "$1" != *.srpm ] > > I didn't notice the above line in my previous post. > Unfortunatly, the file globing is expanding to multiple > arguments. > > You will have to u

Re: bash: [: too many arguments WAS: Re: [OT] help with bash script

2001-02-15 Thread Jonathan Wilson
Hey, cool! The line if [ ! -z "${1##*.src.rpm}" ] && [ ! -z "${1##*.srpm}" ] works perfect, and it got rid of the echoing "Terminated" too! Thanks a ton dude :-) At 03:17 PM 2/15/2001 -0800, you wrote: >On Thu, 15 Feb 2001, Jonathan Wilson wrote: > > >> if [ "$1" != *.src.rpm ] && [ "$1" !=

Re: bash: [: too many arguments WAS: Re: [OT] help with bash script

2001-02-15 Thread John H Darrah
On Thu, 15 Feb 2001, Jonathan Wilson wrote: > if [ "$1" != *.src.rpm ] && [ "$1" != *.srpm ] I didn't notice the above line in my previous post. Unfortunatly, the file globing is expanding to multiple arguments. You will have to use a `case' statement or other trickery. Maybe like this: i

Re: bash: [: too many arguments WAS: Re: [OT] help with bash script

2001-02-15 Thread Jonathan Wilson
In addition, I find now that it's not performing the tests anymore. As per this example: [root@csc003 SrcRpms]# ~/Scripts/srpm_arch_tester.sh ladeda /root/Scripts/srpm_arch_tester.sh: [: too many arguments i386 failed i486 failed i586 failed i686 failed athlon failed test done Terminated Thou

bash: [: too many arguments WAS: Re: [OT] help with bash script

2001-02-15 Thread Jonathan Wilson
Still no-go. Same exact message. I tried stracing it but it's didn't really tell me anything. I also tried -noprofile, thinking that it might be the bashrc that was different. It didn't care. Here's the current version: #!/bin/bash -noprofile #srpm_arch_tester.sh trap 'kill 0' 0 1 2 3 if [ -

Re: [OT] help with bash script

2001-02-15 Thread John H Darrah
On Thu, 15 Feb 2001, Todd A. Jacobs wrote: > On Thu, 15 Feb 2001, John H Darrah wrote: > > > To answer your last question, "kill 0" is equivalent to > > "kill -15 -0". > > This isn't a valid command. There's no signal 0 (run "kill -l" for proof), > and no PID 0, either. What exactly is this sup

Re: [OT] help with bash script

2001-02-15 Thread Todd A. Jacobs
On Thu, 15 Feb 2001, John H Darrah wrote: > To answer your last question, "kill 0" is equivalent to > "kill -15 -0". This isn't a valid command. There's no signal 0 (run "kill -l" for proof), and no PID 0, either. What exactly is this supposed to accomplish? -- Todd A. Jacobs CodeGnome Consult

Re: [OT] help with bash script

2001-02-15 Thread John H Darrah
On Thu, 15 Feb 2001, Jonathan Wilson wrote: > /root/Scripts/srpm_arch_tester.sh: [: too many arguments > Terminated > > > #!/bin/bash > #srpm_arch_tester.sh > > trap 'kill 0' 0 1 2 3 > > if [ -z $1 ] > then Quote your variables with double quotes like the following: if [ -z "$1" ]

Re: [OT] help with bash script

2001-02-15 Thread Jonathan Wilson
John, Thanks so much for helping, that really worked! Now I have a stranger problem: I developed this script on a RH 6.2 server and it works fine, but when O move it to another RH 6.2 server and try to run it, I get the following error: [root@csc003 SrcRpms]# ~/Scripts/srpm_arch_tester.sh glib

Re: [OT] help with bash script

2001-02-15 Thread John H Darrah
On Wed, 14 Feb 2001, rpjday wrote: > > >Try: > > >trap 'kill 0' 0 1 2 3 > > > > > >This should cleanup all the children. > > huh? i understand all of the above except for the "kill > 0" command. what does it mean to say "kill 0"? what > signal is being sent to what, exactly? To ans

Re: [OT] help with bash script

2001-02-14 Thread John H Darrah
On Wed, 14 Feb 2001, rpjday wrote: > > > > > >Try: > > >trap 'kill 0' 0 1 2 3 > > > > > >This should cleanup all the children. > > huh? i understand all of the above except for the "kill > 0" command. what does it mean to say "kill 0"? what > signal is being sent to what, exactly? S

Re: [OT] help with bash script

2001-02-14 Thread John H Darrah
On Mon, 12 Feb 2001, Jonathan Wilson wrote: > At 08:25 PM 2/10/2001 -0800, you wrote: > > > >Try: > > > >trap 'kill 0' 0 1 2 3 > > > >This should cleanup all the children. > > Do I then need to change "function cleanup ()" to > "function kill 0 ()" ? Can it be two words like that? or > i

Re: [OT] help with bash script

2001-02-14 Thread rpjday
On Mon, 12 Feb 2001, Jonathan Wilson wrote: > At 08:25 PM 2/10/2001 -0800, you wrote: > >On Sat, 10 Feb 2001, Jonathan Wilson wrote: > > > >> I wonder if someone could help with a script I'm trying to > >> write. What this script does is rebuild a src.rpm in > >> every possible architecture, and

Re: [OT] help with bash script

2001-02-14 Thread Jonathan Wilson
At 08:25 PM 2/10/2001 -0800, you wrote: >On Sat, 10 Feb 2001, Jonathan Wilson wrote: > >> I wonder if someone could help with a script I'm trying to >> write. What this script does is rebuild a src.rpm in >> every possible architecture, and report if it's successful >> or not, as well as log the

Re: [OT] help with bash script

2001-02-10 Thread John H Darrah
On Sat, 10 Feb 2001, Jonathan Wilson wrote: > I wonder if someone could help with a script I'm trying to > write. What this script does is rebuild a src.rpm in > every possible architecture, and report if it's successful > or not, as well as log the output. While writing it I > discovered that

[OT] help with bash script

2001-02-10 Thread Jonathan Wilson
Howdy, I wonder if someone could help with a script I'm trying to write. What this script does is rebuild a src.rpm in every possible architecture, and report if it's successful or not, as well as log the output. While writing it I discovered that hitting ^C gave my the prompt back, but didn't

Re: [OT] tyro bash script question

2001-02-01 Thread Cameron Simpson
On Thu, Feb 01, 2001 at 05:40:30PM -0800, Hidong Kim <[EMAIL PROTECTED]> wrote: | I have the following bash script called push: | | #!/bin/bash | | pushd () | { | dirname=$1 | DIR_STACK="$dirname ${DIR_STACK:-$PWD' '}" | cd ${dirname:?"missi

  1   2   >