Re: Bash Help: Renaming all files in a Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thom Paine wrote:
>>
>>A little while loop would be one way to do this:
>>
>>ls "Family Pic"*.jpg | while read i; do mv "$i" $(echo $i | tr " " _)
>>
> 
> 
> I tried this command and it gives me a> prompt and sits there. Am I
> doing something wrong?
> 
> And thanks to all the replies.

Tonight's not my night.  There should be a "; done" at the end.  As in

ls "Family Pic"*.jpg | while read i; do mv "$i" $(echo $i | tr " " _); done

But as Patrick and Mikkel pointed out, the for loop would work and
that's less typing. :)

- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
======================================================================
Teach a man to make fire, and he will be warm for a day.  Set a man on
fire, and he will be warm for the rest of his life.
    -- John A. Hrastar

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.4 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

iG0EARECAC0FAkTBi2cmGGh0dHA6Ly93d3cucG9ib3guY29tL350bXovcGdwL3Rt
ei5hc2MACgkQuv+09NZUB1qK9wCfWcu+GhCjZrEQIG78ULRRn0s+8KIAmwazFMKk
YQ5QTm9J+DbiLSPGSXuk
=co/d
-----END PGP SIGNATURE-----


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux