Gentoo Archives: gentoo-user

From: Mark Knecht <markknecht@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Simple command line stuff
Date: Mon, 10 Oct 2005 15:03:01
Message-Id: 5bdc1c8b0510100757v3c7396ccs79eeb5343f8dd57c@mail.gmail.com
In Reply to: Re: [gentoo-user] Simple command line stuff by "Spider (D.m.D. Lj.)"
1 On 10/10/05, Spider (D.m.D. Lj.) <spider@g.o> wrote:
2 > On Sun, 2005-10-09 at 19:06 -0700, Mark Knecht wrote:
3 > > Hi,
4 > > I don't have a single book on Linux. (Amazing...) Can someone
5 > > recommend a simple book on command line stuff, or better yet a good
6 > > web site on this topic?
7 > >
8 > > For instance, I wanted to run a specific command on every file in a
9 > > directory which will create a new file, so I need to do
10 > >
11 > > command file1.wav file1-convert.wav
12 > >
13 > > I need to take each name, create a new name to build the actual
14 > > command that gets run and then do that for every file in the
15 > > directory, or even in a hierarchy of directories.
16 > >
17 > > Thanks,
18 > > Mark
19 >
20 >
21 >
22 > For bash / zsh and other advanced(?-) shells:
23 >
24 > for f in *.wav; do command "$f" "${f/.wav/-convert.wav}";done
25 >
26 > The " " are there to prevent files with spaces in them (evil!) from
27 > becoming too annoying and appearing as multiple commandline arguments.
28 >
29 >
30 > //Spider
31 >
32
33 Thanks to all for the great answers and pointers. I appreciate it very much.
34
35 Cheers,
36 Mark
37
38 --
39 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Simple command line stuff Drew Tomlinson <drew@××××××××××××××.net>