public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Spider (D.m.D. Lj.)" <spider@gentoo.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Simple command line stuff
Date: Mon, 10 Oct 2005 11:00:37 +0200	[thread overview]
Message-ID: <1128934837.3551.1.camel@Darkmere.darkmere> (raw)
In-Reply-To: <5bdc1c8b0510091906s2631d15bh46dc269fcb312534@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On Sun, 2005-10-09 at 19:06 -0700, Mark Knecht wrote:
> Hi,
>    I don't have a single book on Linux. (Amazing...) Can someone
> recommend a simple book on command line stuff, or better yet a good
> web site on this topic?
> 
>    For instance, I wanted to run a specific command on every file in a
> directory which will create a new file, so I need to do
> 
> command    file1.wav    file1-convert.wav
> 
> I need to take each name, create a new name to build the actual
> command that gets run and then do that for every file in the
> directory, or even in a hierarchy of directories.
> 
> Thanks,
> Mark



For bash / zsh and other advanced(?-) shells: 

for f in *.wav; do command "$f" "${f/.wav/-convert.wav}";done

The " " are there to prevent files with spaces in them (evil!) from
becoming too annoying and appearing as multiple commandline arguments.


//Spider

-- 
begin  .signature
Tortured users / Laughing in pain
See Microsoft KB Article Q265230 for more information.
end


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-10-10  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-10  2:06 [gentoo-user] Simple command line stuff Mark Knecht
2005-10-10  2:18 ` Jason Cooper
2005-10-10  2:20 ` Brett I. Holcomb
2005-10-10  2:22 ` Daniel Lynch
2005-10-10  2:32   ` Jason Cooper
2005-10-10  3:09 ` Nick Rout
2005-10-10  7:59 ` Neil Bothwick
2005-10-10  9:00 ` Spider (D.m.D. Lj.) [this message]
2005-10-10 14:57   ` Mark Knecht
2005-10-11  7:25     ` Drew Tomlinson
2005-10-11  8:09       ` Spider (D.m.D. Lj.)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1128934837.3551.1.camel@Darkmere.darkmere \
    --to=spider@gentoo.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox