Re: Shell Expansion in Bourne Shell Script Question

2010-07-30 Thread Chris Davies
Karl Vogel wrote: > for file in $(ls $MAGDIR/*.[Zz][Ii][Pp] 2> /dev/null); do ... mkdir $MAGDIR/silly.zip touch $MAGDIR/silly.zip/not-a-zip-file If you're going to insist on using "ls" you should consider "ls -d". Personally, I'd still go for this construct: for FILE in "$MAGDIR"/*.[

Re: Shell Expansion in Bourne Shell Script Question

2010-07-29 Thread Boyd Stephen Smith Jr.
On Thursday 29 July 2010 05:27:35 Mart Frauenlob wrote: > On 29.07.2010 07:17, Boyd Stephen Smith Jr. wrote: > > On Wednesday 28 July 2010 21:37:44 Karl Vogel wrote: > >> I need to think before posting. I didn't mention that I have > >> FreeBSD, Linux, and Solaris boxes, and unfortunately

Re: Shell Expansion in Bourne Shell Script Question

2010-07-29 Thread Mart Frauenlob
On 29.07.2010 07:17, Boyd Stephen Smith Jr. wrote: On Wednesday 28 July 2010 21:37:44 Karl Vogel wrote: On Thu, 29 Jul 2010 01:04:27 -, Cameron Hutchison said: C> find $MAGDIR -iname '*.zip' -print0 | xargs -0 some-command C> -iname matches names case insensitively. Since you then

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Boyd Stephen Smith Jr.
On Wednesday 28 July 2010 21:37:44 Karl Vogel wrote: > >> On Thu, 29 Jul 2010 01:04:27 -, > > >> Cameron Hutchison said: > C>find $MAGDIR -iname '*.zip' -print0 | xargs -0 some-command > C> -iname matches names case insensitively. Since you then dont need grep, > C> you also dont need tr0

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Boyd Stephen Smith Jr.
On Wednesday 28 July 2010 13:05:22 Karl Vogel wrote: > >> On 28.07.2010 14:42, Jochen Schulz wrote: > J> I think you meant to write > J> for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]` > J> Another hint: you don't need 'ls' for your case at all. > >I'd recommend keeping the "ls". Then, you wou

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Karl Vogel
>> On Thu, 29 Jul 2010 01:04:27 -, >> Cameron Hutchison said: C>find $MAGDIR -iname '*.zip' -print0 | xargs -0 some-command C> -iname matches names case insensitively. Since you then dont need grep, C> you also dont need tr0. I need to think before posting. I didn't mention that I h

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Cameron Hutchison
vogelke+deb...@pobox.com (Karl Vogel) writes: >>> On Wed, 28 Jul 2010 23:58:11 +0200, >>> Mart Frauenlob said: >M> One might be better of with some like this: >M> find /DIR -regextype posix-egrep -regex '.*\.(zip|ZIP)' -exec \ >M> some_command {} + > If the filelist is potentially too

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Karl Vogel
>> On Wed, 28 Jul 2010 23:58:11 +0200, >> Mart Frauenlob said: M> One might be better of with some like this: M> find /DIR -regextype posix-egrep -regex '.*\.(zip|ZIP)' -exec \ M> some_command {} + If the filelist is potentially too big for the max argument list on the system, I wou

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Mart Frauenlob
On 28.07.2010 20:05, Karl Vogel wrote: On 28.07.2010 14:42, Jochen Schulz wrote: J> I think you meant to write J> for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]` J> Another hint: you don't need 'ls' for your case at all. I'd recommend keeping the "ls". Try your script when MAGDIR doesn'

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Karl Vogel
>> On 28.07.2010 14:42, Jochen Schulz wrote: J> I think you meant to write J> for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]` J> Another hint: you don't need 'ls' for your case at all. I'd recommend keeping the "ls". Try your script when MAGDIR doesn't have any zipfiles, and MAGFILE will ho

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Christian Jaeger
> for MAGFILE in $MAGDIR/*.zip Don't forget the double quotes around variable references. It's better to always do that by default than to fix it afterwards (either because you feed it paths with whitespace in them yourself at some point or because someone else is trying to close the safety holes

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Clive Standbridge
> for MAGFILE in `ls *.[Zz][Ii][Pp] $MAGDIR/`; do > #lots of other stuff > done As others noted, the ls command is superfluous and possibly harmful here. One more thing you can do is case-insensitive pathname expansion: shopt -s nocaseglob for MAGFILE in $MAGDIR/*.zip do #lots of other

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Paul E Condon
On 20100728_082732, Martin McCormick wrote: > Cesar Garcia writes: > > Perhaps, try with this: > > > > for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]`; do It probably doesn't really matter in practice, but this will pick up also files that match $MAGDIR/*.zIp , etc. (mixed case) To avoid getting the

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Mart Frauenlob
On 28.07.2010 14:42, Jochen Schulz wrote: Martin McCormick: ls *.[Zz][Ii][Pp] Note that 'ls' doesn't see this pattern at all. The pattern is expanded by the shell to all existing files matching the pattern. This list of files is then passed to ls. Using 'echo' would yield (almost) the same re

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Martin McCormick
Cesar Garcia writes: > Perhaps, try with this: > > for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]`; do That worked. Thank you. As soon as I saw the example, I realized that in the script, there was no way for it to know where these files were that I was looking for. Also my thanks to

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Jochen Schulz
Martin McCormick: > > ls *.[Zz][Ii][Pp] Note that 'ls' doesn't see this pattern at all. The pattern is expanded by the shell to all existing files matching the pattern. This list of files is then passed to ls. Using 'echo' would yield (almost) the same result in this case. > for MAGFILE in

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Jordon Bedwell
On 7/28/10 7:06 AM, Jordon Bedwell wrote: #!/bin/sh for MAGFILE in $(ls *\.[zZ][iI][pP]) do echo "File: $MAGFILE"; done I would prefer to rely on $() before `` in a bash script. Sorry, I did that script on OS X, you should switch the SH shebang to Bash, it's just aliased on OS X but not on

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Jordon Bedwell
On 7/28/10 6:33 AM, Martin McCormick wrote: I could have sworn I have done this before but obviously not because I can't get it to work no matter what I try. I am running a shell script that is supposed to find every .zip or .ZIP file in a directory and do an extraction of the co

Re: Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Cesar Garcia
Perhaps, try with this: for MAGFILE in `ls $MAGDIR/*.[Zz][Ii][Pp]`; do El 28/07/10 13:33, Martin McCormick escribió: > I could have sworn I have done this before but obviously > not because I can't get it to work no matter what I try. > > I am running a shell script that is suppos

Shell Expansion in Bourne Shell Script Question

2010-07-28 Thread Martin McCormick
I could have sworn I have done this before but obviously not because I can't get it to work no matter what I try. I am running a shell script that is supposed to find every .zip or .ZIP file in a directory and do an extraction of the contents. I don't want any other files to be inc

Re: bash script question

2008-04-19 Thread Tzafrir Cohen
On Fri, Apr 18, 2008 at 08:39:10PM -0600, ChadDavis wrote: > > > > I just wonder if this is supposed to be used where 'svn export' better > > be. > > > > > > No, its the Sysdeo tomcat plugin's export WAR file feature. it doesn't, as > far as I can tell, have a mechanism for filtering out things l

Re: bash script question

2008-04-18 Thread ChadDavis
> > I just wonder if this is supposed to be used where 'svn export' better > be. > > No, its the Sysdeo tomcat plugin's export WAR file feature. it doesn't, as far as I can tell, have a mechanism for filtering out things like .svn.

Re: bash script question

2008-04-18 Thread Tzafrir Cohen
On Fri, Apr 18, 2008 at 10:27:30AM -0600, ChadDavis wrote: > I have a simple bash scripting question. > > I have a tree of directories from which I would like to recursively dig > into, removing source control meta-information from. In this case, the > meta-data is in .svn folders. I just wonder

Re: bash script question

2008-04-18 Thread Bob McGowan
Jochen Schulz wrote: Ken Irving: If you want to remove the .svn/ directories and everything within them, something like this should work (remove the 'echo' if the output looks ok): $ cd starting/directory $ find . -type d -name .svn -exec echo rm -r {} \; GNU find also accepts the parame

Re: bash script question

2008-04-18 Thread Jochen Schulz
Ken Irving: > > If you want to remove the .svn/ directories and everything within them, > something > like this should work (remove the 'echo' if the output looks ok): > > $ cd starting/directory > $ find . -type d -name .svn -exec echo rm -r {} \; GNU find also accepts the parameter (or be

Re: bash script question

2008-04-18 Thread ChadDavis
Good to know. Thank. On Fri, Apr 18, 2008 at 11:49 AM, Bob McGowan <[EMAIL PROTECTED]> wrote: > ChadDavis wrote: > > > I have a simple bash scripting question. > > > > I have a tree of directories from which I would like to recursively dig > > into, removing source control meta-information from.

Re: bash script question

2008-04-18 Thread Bob McGowan
ChadDavis wrote: I have a simple bash scripting question. I have a tree of directories from which I would like to recursively dig into, removing source control meta-information from. In this case, the meta-data is in .svn folders. Does anyone have any elegant suggestions on how to do this?

Re: bash script question

2008-04-18 Thread Ken Irving
On Fri, Apr 18, 2008 at 10:27:30AM -0600, ChadDavis wrote: > I have a simple bash scripting question. > > I have a tree of directories from which I would like to recursively dig into, > removing source > control meta-information from. In this case, the meta-data is in .svn > folders. > > Does

Re: bash script question

2008-04-18 Thread ChadDavis
That's great. I also saw in Unix Power Tools that you can use xargs to similar effect? On Fri, Apr 18, 2008 at 10:55 AM, Martin Kraus <[EMAIL PROTECTED]> wrote: > On Fri, Apr 18, 2008 at 10:27:30AM -0600, ChadDavis wrote: > > I have a simple bash scripting question. > > > > I have a tree of dire

bash script question

2008-04-18 Thread ChadDavis
I have a simple bash scripting question. I have a tree of directories from which I would like to recursively dig into, removing source control meta-information from. In this case, the meta-data is in .svn folders. Does anyone have any elegant suggestions on how to do this?

Re: Bash script question

2006-12-20 Thread Michelle Konzack
Am 2006-12-07 15:20:26, schrieb H.S.: > Stephen R Laniel wrote: > >find directoryName -mtime +X -print0 |xargs -0 rm '{}' This can handel daily files for unlimited years > $> find directoryName -mtime +X -exec rm -f '{}' \; This can handel only files from the last 15 years :-P Thanks, Greeti

Re: Bash script question

2006-12-08 Thread Bob McGowan
The '-print0' of 'find' and the '-0' of 'xargs' (those are the number zero, not a capital o) prevent problems processing file names that contain white space (such as you might get from other OS's, but can also get on UNIX/Linux systems when using GUI programs that create files). It uses a 'nul

Re: Bash script question

2006-12-07 Thread Nate Bargmann
* Almut Behrens <[EMAIL PROTECTED]> [2006 Dec 07 16:08 -0600]: > On Thu, Dec 07, 2006 at 03:41:53PM -0600, Ron Johnson wrote: > > > > OP specifically noted: > > I'm not interested in the actual created/modified date The reason for that was so I don't clobber other files that may be older, jus

Re: Bash script question

2006-12-07 Thread Almut Behrens
On Thu, Dec 07, 2006 at 03:41:53PM -0600, Ron Johnson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 12/07/06 15:12, Almut Behrens wrote: > > On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: > >> I have a directory of files that are created daily using > >> filename

Re: Bash script question

2006-12-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/07/06 15:12, Almut Behrens wrote: > On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: >> I have a directory of files that are created daily using >> filename-`date +%Y%m%d`.tar.gz so I have a directory with files whose >> names adva

Re: Bash script question

2006-12-07 Thread Kevin Mark
On Thu, Dec 07, 2006 at 11:41:23AM -0700, John Schmidt wrote: > On Thursday 07 December 2006 11:16, Nate Bargmann wrote: > > Since there is a lot of knowledge on this list, I thought I'd aske > > here. > > > > This may be trivial, but I'm not even sure how to search for what I > > want to do. > > >

Re: Bash script question

2006-12-07 Thread Almut Behrens
On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: > > I have a directory of files that are created daily using > filename-`date +%Y%m%d`.tar.gz so I have a directory with files whose > names advance from filename-20061201.tar.gz to filename-20061202.tar.gz > to filename-20061203.tar.

Re: Bash script question

2006-12-07 Thread Ken Irving
On Thu, Dec 07, 2006 at 07:57:29PM +0100, Albert Dengg wrote: > On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: > > Since there is a lot of knowledge on this list, I thought I'd aske > > here. > > > > This may be trivial, but I'm not even sure how to search for what I > > want to do

Re: Bash script question

2006-12-07 Thread H.S.
Stephen R Laniel wrote: The easiest way wouldn't involve the filename at all. If you know that a file created on date D is stamped with date D -- i.e., if your files all look like so: (13:09) [EMAIL PROTECTED]:~$ ls filename-20061207.tar.gz -rw-r--r-- 1 slaniel slaniel 0 2006-12-07 13:09 file

Re: Bash script question

2006-12-07 Thread Albert Dengg
On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: > Since there is a lot of knowledge on this list, I thought I'd aske > here. > > This may be trivial, but I'm not even sure how to search for what I > want to do. > > I have a directory of files that are created daily using > filenam

Re: Bash script question

2006-12-07 Thread Ben Breslauer
Nate Bargmann wrote: I have a directory of files that are created daily using filename-`date +%Y%m%d`.tar.gz so I have a directory with files whose names advance from filename-20061201.tar.gz to filename-20061202.tar.gz to filename-20061203.tar.gz and so on. Based on the date in the filename, I

Re: Bash script question

2006-12-07 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/07/06 12:16, Nate Bargmann wrote: > Since there is a lot of knowledge on this list, I thought I'd aske > here. > > This may be trivial, but I'm not even sure how to search for what I > want to do. > > I have a directory of files that are create

Re: Bash script question

2006-12-07 Thread John Schmidt
On Thursday 07 December 2006 11:16, Nate Bargmann wrote: > Since there is a lot of knowledge on this list, I thought I'd aske > here. > > This may be trivial, but I'm not even sure how to search for what I > want to do. > > I have a directory of files that are created daily using > filename-`date +

Re: Bash script question

2006-12-07 Thread Stephen R Laniel
On Thu, Dec 07, 2006 at 12:16:54PM -0600, Nate Bargmann wrote: > I have a directory of files that are created daily using > filename-`date +%Y%m%d`.tar.gz so I have a directory with files whose > names advance from filename-20061201.tar.gz to filename-20061202.tar.gz > to filename-20061203.tar.gz

Bash script question

2006-12-07 Thread Nate Bargmann
Since there is a lot of knowledge on this list, I thought I'd aske here. This may be trivial, but I'm not even sure how to search for what I want to do. I have a directory of files that are created daily using filename-`date +%Y%m%d`.tar.gz so I have a directory with files whose names advance fr

Re: Shell script question

2006-04-02 Thread Michelle Konzack
Am 2006-03-22 09:43:57, schrieb Andras Lorincz: > ENTRY=$(cat input_file) > > for I in $ENTRY > do > ... > done > > I found a solution for this: > > LINES=$(wc -l input_file) > while [ $LINES -gt 0 ] > do > ENTRY=$(sed -e '1q' input_file) > #do smth > sed -e '2,$w input_file' input_file >

Re: Shell script question

2006-03-24 Thread Mario 'BitKoenig' Holbe
Luis R Finotti <[EMAIL PROTECTED]> wrote: > Mario 'BitKoenig' Holbe wrote: >> while read i; do >> echo "$i" >> done < input_file > And if the spaces give you trouble, add They don't. regards Mario -- There are two major products that come from Berkeley: LSD and UNIX. We don't believe th

Re: Re: Stupid shell script question about "read" [SOLVED]

2006-03-22 Thread Neal Murphy
Kevin, Looking for a solution to *my* problem (strange networking problem with debian testing), I saw your post and thought I'd respond. > # set some variables to nightmarish values for testing purposes > d='"ab\""q"' # literal value is "ab\""q" > e='$d' # literal v

Re: Shell script question

2006-03-22 Thread Bob McGowan
The generally accepted way to deal with IFS is to save the current value and restore when done: ifs=$IFS IFS=' ' ... IFS=$ifs But, of course, this is a change local to the script being run, so when it exits, the change would be 'forgotten' anyway, since it's local to the sub shell that was ru

Re: Shell script question

2006-03-22 Thread Luis R Finotti
Mario 'BitKoenig' Holbe wrote: Andras Lorincz <[EMAIL PROTECTED]> wrote: ENTRY=3D$(cat input_file) for I in $ENTRY while read i; do echo "$i" done < input_file regards Mario And if the spaces give you trouble, add - IFS=' ' - That's just a "newline" between t

Re: Shell script question

2006-03-22 Thread Mario 'BitKoenig' Holbe
Andras Lorincz <[EMAIL PROTECTED]> wrote: > ENTRY=3D$(cat input_file) > for I in $ENTRY while read i; do echo "$i" done < input_file regards Mario -- reich sein heisst nicht, einen Ferrari zu kaufen, sondern einen zu verbrennen Dietmar W

Shell script question

2006-03-21 Thread Andras Lorincz
Hi,   What I want is this: I have a file in which a list of files or directories are present, like below (let's name this file input_file):   /mnt/hda6/File1 /mnt/hda5/Directory1 /mnt/hda6/File2 /mnt/hda6/File3 /mnt/hda6/Directory2 ...   In a shell script I want to read this file line by line an

Re: Stupid shell script question about "read" [SOLVED]

2006-03-03 Thread Kevin B. McCarty
I wrote: > Could someone tell me why the following works in zsh but not in > bash/posh/dash? > > benjo[3]:~% echo foo bar baz | read a b c > benjo[4]:~% echo $a $b $c > foo bar baz Thanks everyone for the enlightening answers! So just to summarize, the problem is that the pipeline is treated a

Re: Stupid shell script question about "read"

2006-03-02 Thread Bill Marcum
On Thu, Mar 02, 2006 at 10:23:20AM -0500, Kevin B. McCarty wrote: > Hi list, > > Could someone tell me why the following works in zsh but not in > bash/posh/dash? > > benjo[3]:~% echo foo bar baz | read a b c > benjo[4]:~% echo $a $b $c > foo bar baz > > If I try the same with bash (or other sh-

Re: Stupid shell script question about "read"

2006-03-02 Thread Alfredo Finelli
On Thursday 02 March 2006 16:23, Kevin B. McCarty wrote: > Hi list, > > Could someone tell me why the following works in zsh but not in > bash/posh/dash? > > benjo[3]:~% echo foo bar baz | read a b c > benjo[4]:~% echo $a $b $c > foo bar baz > > If I try the same with bash (or other sh-compatible s

Re: Stupid shell script question about "read"

2006-03-02 Thread Andrew Cady
On Thu, Mar 02, 2006 at 10:23:20AM -0500, Kevin B. McCarty wrote: > Hi list, > > Could someone tell me why the following works in zsh but not in > bash/posh/dash? > > benjo[3]:~% echo foo bar baz | read a b c > benjo[4]:~% echo $a $b $c > foo bar baz > > If I try the same with bash (or other sh-

Re: Stupid shell script question about "read"

2006-03-02 Thread Almut Behrens
On Thu, Mar 02, 2006 at 09:19:02AM -0800, David Kirchner wrote: > On 3/2/06, Kevin B. McCarty <[EMAIL PROTECTED]> wrote: > > Hi list, > > > > Could someone tell me why the following works in zsh but not in > > bash/posh/dash? > > > > benjo[3]:~% echo foo bar baz | read a b c > > benjo[4]:~% echo $a

Re: Stupid shell script question about "read"

2006-03-02 Thread Joerg M. Sigle
Hi, Kevin. I don't have a solution, but I found that interesting, so did some experiments: $ bash --version bash --version GNU bash, version 3.1.0(1)-release (i486-pc-linux-gnu) Copyright (C) 2005 Free Software Foundation, Inc. $ echo foo | read a; echo $a returns empty variable a whole lot of

Re: Stupid shell script question about "read"

2006-03-02 Thread David Kirchner
On 3/2/06, Kevin B. McCarty <[EMAIL PROTECTED]> wrote: > Hi list, > > Could someone tell me why the following works in zsh but not in > bash/posh/dash? > > benjo[3]:~% echo foo bar baz | read a b c > benjo[4]:~% echo $a $b $c > foo bar baz > > If I try the same with bash (or other sh-compatible she

Stupid shell script question about "read"

2006-03-02 Thread Kevin B. McCarty
Hi list, Could someone tell me why the following works in zsh but not in bash/posh/dash? benjo[3]:~% echo foo bar baz | read a b c benjo[4]:~% echo $a $b $c foo bar baz If I try the same with bash (or other sh-compatible shells), the variables $a $b and $c are unset. From the bash man page: >

Re: shell script question

2004-01-26 Thread Johann Spies
On Mon, Jan 26, 2004 at 10:36:13AM -0200, Leandro Guimarães Faria Corcete Dutra wrote: > Em Sáb, 2004-01-24 às 04:44, tripolar escreveu: > > I would like to download all files from an ftp site. probably 250 files > > some between 25-50 Megs.I am wondering about using wget with shell ( > > bash) scr

Re: shell script question

2004-01-26 Thread Leandro Guimarães Faria Corcete Dutra
Em SÃb, 2004-01-24 Ãs 04:44, tripolar escreveu: > I would like to download all files from an ftp site. probably 250 files > some between 25-50 Megs.I am wondering about using wget with shell ( > bash) script to login, download all files, if one is found on harddrive > ignore and goto next one. one

Re: shell script question

2004-01-26 Thread Jan Minar
On Sat, Jan 24, 2004 at 02:26:49PM +0100, Matthias Hentges wrote: > There's no need for a script. Just use wget -> man wget. Or ncftp. HTH. -- Jan Minar "Please don't CC me, I'm subscribed." x 9 pgp0.pgp Description: PGP signature

Re: shell script question

2004-01-24 Thread Matthias Hentges
Am Sam, 2004-01-24 um 07.44 schrieb tripolar: > I would like to download all files from an ftp site. probably 250 files > some between 25-50 Megs.I am wondering about using wget with shell ( > bash) script to login, download all files, if one is found on harddrive > ignore and goto next one. one fi

shell script question

2004-01-23 Thread tripolar
I would like to download all files from an ftp site. probably 250 files some between 25-50 Megs.I am wondering about using wget with shell ( bash) script to login, download all files, if one is found on harddrive ignore and goto next one. one file at a time to prevent using too much of their bandwi

Re: init-script question: iptables and networking

2004-01-19 Thread Christian Schnobrich
On Mon, 2004-01-19 at 01:21, Antony Gelberg wrote: > Have a look in /etc/defaults/iptables. This suggests that the package Aha. Hmmm. I wonder, would I ever have found this myself...? [assume a medium-sized rant about hidden docs here. It's just that I'm too lazy to actually write it, and besid

Re: init-script question: iptables and networking

2004-01-18 Thread Antony Gelberg
On Sun, Jan 18, 2004 at 11:35:13PM +0100, Christian Schnobrich wrote: > Hello, > > like many, I have an old box set up as gateway. Upon reboot, I'd like it > to load the appropriate iptables rules and set /proc/../ip_forward to 1. > > Until now, I'm doing this by a self-made "init script" that wi

init-script question: iptables and networking

2004-01-18 Thread Christian Schnobrich
Hello, like many, I have an old box set up as gateway. Upon reboot, I'd like it to load the appropriate iptables rules and set /proc/../ip_forward to 1. Until now, I'm doing this by a self-made "init script" that will do just that, but won't understand any of the usual start|stop|restart|[etc] op

Re: shell script question

2003-12-05 Thread Andrew Schulman
> Is there any way to export a variable for one parent shell to a different > parent shell? No. But what you can do is to have your child script output a set of assignment statements, which can then be executed by the parent. For example if 'child' is a script that writes FOO=bar BAD=good t

Re: shell script question

2003-12-05 Thread David Z Maze
"Han Huynh" <[EMAIL PROTECTED]> writes: > I know this isn't a bash/korn shell script news group, but the fact is > I can't find one. Since bash/ksh is the default linux shell, I was > hoping someone could answer a few pretty simple questions. > > Is there any way to export a variable for one par

Re: shell script question

2003-12-05 Thread HdV
On Fri, 5 Dec 2003, Han Huynh wrote: > Is there any way to export a variable for one parent shell to a different > parent shell? I know that export will work to a subshell, but I can't find > any process to return a variable to a different parent shell. I am not sure I understand your question,

shell script question

2003-12-04 Thread Han Huynh
I know this isn't a bash/korn shell script news group, but the fact is I can't find one. Since bash/ksh is the default linux shell, I was hoping someone could answer a few pretty simple questions. Is there any way to export a variable for one parent shell to a different parent shell? I know

Re: shell script question

2003-10-13 Thread Jeff Elkins
On Monday 13 October 2003 4:39 am, Rob Weir wrote: >You're not converting an mp3 to a wav and then back again, are you? Have to, unless you know of a utility that will repair mp3s. I suspect the original encoder was sloppy, but these in particular report garbage in the headers, plus other proble

Re: shell script question

2003-10-13 Thread Colin Watson
On Mon, Oct 13, 2003 at 11:27:23AM -0400, David Z Maze wrote: > Carlos Sousa <[EMAIL PROTECTED]> writes: > > On Mon, 13 Oct 2003 08:30:23 +0100 Colin Watson wrote: > >> Here's a little expression that strips off any trailing "." > >> from $1 and tacks on ".wav". > >> > >> "${1%.*}.wav" > > > > T

Re: shell script question

2003-10-13 Thread David Z Maze
Carlos Sousa <[EMAIL PROTECTED]> writes: > On Mon, 13 Oct 2003 08:30:23 +0100 Colin Watson wrote: > >> Here's a little expression that strips off any trailing "." >> from $1 and tacks on ".wav". >> >> "${1%.*}.wav" > > That's much better, no dependency on yet another utility, so more portable >

Re: shell script question

2003-10-13 Thread Rob Weir
begin Jeff Elkins quote from Sun, Oct 12, 2003 at 11:18:11PM -0400 > In the same vein, I'm working through a list of mp3s where some of them need > re-encoding. First, I convert them to wavs with this script fragment: > > mpg123 -b 1 -s "$1" | sox -t raw -r 44100 -s -w -c2 - "$2" You're not

Re: shell script question

2003-10-13 Thread Carlos Sousa
On Mon, 13 Oct 2003 08:30:23 +0100 Colin Watson wrote: > On Sun, Oct 12, 2003 at 11:18:11PM -0400, Jeff Elkins wrote: > > mpg123 -b 1 -s "$1" | sox -t raw -r 44100 -s -w -c2 - "$2" > > > > In every case, $1 and $2 are the same, except for $2 I want the output > > filename to have a .wav extens

Re: shell script question

2003-10-13 Thread Colin Watson
On Sun, Oct 12, 2003 at 11:18:11PM -0400, Jeff Elkins wrote: > In the same vein, I'm working through a list of mp3s where some of them need > re-encoding. First, I convert them to wavs with this script fragment: > > mpg123 -b 1 -s "$1" | sox -t raw -r 44100 -s -w -c2 - "$2" > > where I feed

Re: shell script question

2003-10-12 Thread Carlos Sousa
On Sun, 12 Oct 2003 23:18:11 -0400 Jeff Elkins wrote: > > In the same vein, I'm working through a list of mp3s where some of them need > re-encoding. First, I convert them to wavs with this script fragment: > > mpg123 -b 1 -s "$1" | sox -t raw -r 44100 -s -w -c2 - "$2" > > where I feed the

Re: shell script question

2003-10-12 Thread Jeff Elkins
On Sunday 12 October 2003 10:35 pm, Jeff Elkins wrote: >On Sunday 12 October 2003 6:50 pm, Colin Watson wrote: >>On Sun, Oct 12, 2003 at 06:37:16PM -0400, Jeff Elkins wrote: >>> I'm trying to write a script to change spaces in a filename to the >>> underscore character: >>> >>> #!/bin/sh >>> for i

Re: shell script question

2003-10-12 Thread Jeff Elkins
On Sunday 12 October 2003 6:50 pm, Colin Watson wrote: >On Sun, Oct 12, 2003 at 06:37:16PM -0400, Jeff Elkins wrote: >> I'm trying to write a script to change spaces in a filename to the >> underscore character: >> >> #!/bin/sh >> for i in *; do >> if test -f $i; then >> mv $i `ec

Re: shell script question

2003-10-12 Thread Colin Watson
On Sun, Oct 12, 2003 at 06:37:16PM -0400, Jeff Elkins wrote: > I'm trying to write a script to change spaces in a filename to the > underscore character: > > #!/bin/sh > for i in *; do > if test -f $i; then > mv $i `echo $i | tr '" "' '_'` > fi > done > > When run, it gives

shell script question

2003-10-12 Thread Jeff Elkins
I'm trying to write a script to change spaces in a filename to the underscore character: #!/bin/sh for i in *; do if test -f $i; then mv $i `echo $i | tr '" "' '_'` fi done When run, it gives me the error "too many args in line four." How can I fix this? Thanks, Jeff Elk

RE: Script question again

2003-04-01 Thread Reaz Baksh
I got a lot of responses that I will experiment with. I tried 'echo -e' and that worked well. Thanks for all the responses Reaz -Original Message- From: Colin Watson [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 9:19 AM To: [EMAIL PROTECTED] Subject: Re: Scrip

Re: Script question again

2003-04-01 Thread Colin Watson
On Tue, Apr 01, 2003 at 08:40:10AM -0500, Rick Pasotto wrote: > On Tue, Apr 01, 2003 at 07:58:24AM -0500, Reaz Baksh wrote: > > I saw a script question posted so I hope someone can help me on this > > simple, I believe, question. > > > > I'm writing a script whe

Re: Script question again

2003-04-01 Thread Rick Pasotto
On Tue, Apr 01, 2003 at 07:58:24AM -0500, Reaz Baksh wrote: > Hello > > I saw a script question posted so I hope someone can help me on this > simple, I believe, question. > > I'm writing a script where people have to input a number, is there a way > to keep the curs

Re: Script question again

2003-04-01 Thread Lukas Ruf
* Reaz Baksh <[EMAIL PROTECTED]> [2003-04-01 15:17]: > Hello > > > I'm writing a script where people have to input a number, is there a way > to keep the curser on the same line as the question? > > I tried using '\c' but that doesn't work. > echo -n "your question" Wouldn't this solve the is

Re: Script question again

2003-04-01 Thread Rus Foster
On Tue, 1 Apr 2003, Reaz Baksh wrote: > Hello > > I saw a script question posted so I hope someone can help me on this > simple, I believe, question. > Hi, How about something like #!/bin/sh read -p "Enter number " Rgds Rus -- www: http://www.65535.net |

Script question again

2003-04-01 Thread Reaz Baksh
Hello I saw a script question posted so I hope someone can help me on this simple, I believe, question.   I’m writing a script where people have to input a number, is there a way to keep the curser on the same line as the question? I tried using ‘\c’ but that doesn’t work.   Any help

Ogg Vorbis, was Re: procmail script question

2001-11-13 Thread Ailbhe Leamy
On (22/07/01 14:43), Lang Hurst wrote: > > That works great. However I am often listening to my vorbis > collection. When my music is playing and a new email comes in, the > festival output just gets garbled with the music. I would like to set > up a procmail script that says > > if xmms is pla

Re: procmail script question

2001-11-11 Thread John Patton
On Sun, Jul 22, 2001 at 02:43:30PM -0700, Lang Hurst wrote: > I use the following procmail script to make festival speak the FROM and > SUBJECT headings of new email through my speakers: > > SUBJECT=`formail -xSubject: \ > | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` > SENDER=`formail -xFrom:

procmail script question

2001-11-11 Thread Lang Hurst
I use the following procmail script to make festival speak the FROM and SUBJECT headings of new email through my speakers: SUBJECT=`formail -xSubject: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` SENDER=`formail -xFrom: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` :0c | echo "New mail f

Re: procmail script question

2001-07-22 Thread John Patton
I would pipe the contents of echo to a shell script. In that script you could test for xmms with something like the following: #!/bin/bash xmms=`ps -ef | grep xmms | grep -v grep` if [ "X$xmms" = "X" ]; then # xmms not running echo "$* | festival --tts" else

procmail script question

2001-07-22 Thread Lang Hurst
I use the following procmail script to make festival speak the FROM and SUBJECT headings of new email through my speakers: SUBJECT=`formail -xSubject: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` SENDER=`formail -xFrom: \ | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'` :0c | echo "New mail f

Re: Dialup script question

2001-05-08 Thread John Hasler
JC Portlock writes: > I don't know that fetchmail will wait for the connection under these > circumstances... It will work fine. -- John Hasler [EMAIL PROTECTED] (John Hasler) Dancing Horse Hill Elmwood, WI

Re: Dialup script question

2001-05-08 Thread JC Portlock
Hi Kieren, One thing I have done that works pretty well for me is to turn 'demand' on in pppconfig. The pon command then allows the pppd call provider to be waiting in the background for any app requesting information from the outside. The connection to my isp is automatic when I issue a com

Re: Dialup script question

2001-05-07 Thread Bud Rogers
On Monday 07 May 2001 20:53, Kieren Diment wrote: > My computer connects to the internet with the following dialup script > at the moment: > > pon > sleep 45s > fetchmail > > I would like to get rid of the line sleep 45s and replace it with a > command that starts up the fetchmail process once pon

Dialup script question

2001-05-07 Thread Kieren Diment
My computer connects to the internet with the following dialup script at the moment: pon sleep 45s fetchmail I would like to get rid of the line sleep 45s and replace it with a command that starts up the fetchmail process once pon has successfully negotiated a connection to the internet (my unde

Re: Shell-script question

2001-02-11 Thread Ethan Benson
On Sun, Feb 11, 2001 at 09:07:02AM -0600, ktb wrote: > > I missed the first part of this so I apologize if I'm repeating but make > the permissions of your script something like - > -rwxrw-rwx1 root root > and see if that helps. no don't, that is a huge security hole. the permissions sh

Re: Shell-script question [solved]

2001-02-11 Thread Andre Berger
On 2001-02-11 14:26 +0100, Andre Berger <[EMAIL PROTECTED]> wrote: > I wrote a shell script "/usr/local/bin/mailcheck" (/usr/local/bin/ is in > $PATH of my potato bash) that gives a list of pon "targets" (diff. > ISPs), and is owned by root., perms 755. I've virtually no experience > with shell scr

  1   2   >