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"/*.[
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
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
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
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
>> 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
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
>> 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
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'
>> 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
> 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
> 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
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
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
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
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
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
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
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
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
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
>
> 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.
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
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
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
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.
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?
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
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
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?
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
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
* 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
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
-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
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.
> >
>
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.
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
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
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
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
-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
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 +
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
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
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
>
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
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
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
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
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
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
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
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-
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
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-
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
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
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
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:
>
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
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
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
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
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
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
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
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
> 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
"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
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,
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
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
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
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
>
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
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
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
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
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
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
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
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
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
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
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
* 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
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 |
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
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
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:
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
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
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
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
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
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
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
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
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 - 100 of 137 matches
Mail list logo