Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: do something with all files in all subdirs

  1. #11
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    --You might want to pick up the O'Reilly book on Bash shell programming. It's been an invaluable help to me. When you put single-ticks around '$file' it doesn't go thru expansion/translation.

    --Anyway, you can try something like this: (Note, the font may be bad, so to clarify - these are CURLY brackets - the shifted ones.) This command, when executed from the root directory (/) will list all the symlinks on your system.
    Code:
    find / -type 'l' -name '*' -exec /bin/ls -l "{}" ";"
    --Morphed to your needs (but only mildly tested)
    Code:
    find -name "*.mpc" -exec id3v2 -d "{}" ";"
    --From ' man find ':
    Code:
    -exec command ;
                  Execute  command;  true  if 0 status is returned.  All following
                  arguments to find are taken to be arguments to the command until
                  an  argument  consisting of `;' is encountered.  The string `{}'
                  is replaced by the current file name being processed  everywhere
                  it occurs in the arguments to the command, not just in arguments
                  where it is alone, as in some versions of find.  Both  of  these
                  constructions might need to be escaped (with a `\') or quoted to
                  protect them from expansion by the shell.  The command  is  exe-
                  cuted in the starting directory.
    --Another short example:
    Code:
    # ===== Find all symlinks and keep a list for later                             
    echo ' *** Finding all symlinks... '                                            
                                                                                    
    # Methodology for this taken from ' info tar ' somewhere                        
    # -mount = Don't descend into other filesystems                                 
    # -print0 seps with NULL char instead of LF                                     
                                                                                    
    find / -type 'l' -name '*' -mount -print0 > /Allsymlinks.NULLlist               
                                                                                    
    echo ' *** Backing up all symlinks *** '                                        
    tar -cvz --null --files-from=/Allsymlinks.NULLlist --file=$Bkpdir/SYMLINKS.tar.gz
    --Note: If you " echo * ", you don't get what you expect. (Type that in w/o the quotes.) Messed up my debugging scripts something awful until I looked it up, now I always put wildcards in single-ticks if I want them displayed as part of a banner.

    Quote Originally Posted by Superstoned
    hmmm, sorry i didnt reply earlier. thought I posted, but I think I forgot to press submit...

    I've been on a festival for some days
    got sick
    so im back home...

    anyway, I still haven't made it.

    when I give the following line:

    for file in $( find -name '*.mpc' ) ; do id3v2 -d $file ; done

    I get:
    (...)
    fopen: ./Overig/Cypress: id3v2: No such file or directory
    fopen: Hill/III: id3v2: No such file or directory
    fopen: (Temples: id3v2: No such file or directory
    fopen: of: id3v2: No such file or directory
    fopen: Boom)/Cypress: id3v2: No such file or directory
    fopen: Hill: id3v2: No such file or directory
    fopen: -: id3v2: No such file or directory
    fopen: 13: id3v2: No such file or directory
    fopen: -: id3v2: No such file or directory
    fopen: Strictly: id3v2: No such file or directory
    fopen: Hip: id3v2: No such file or directory
    fopen: Hop.mpc: id3v2: No such file or directory
    (...)

    there seems to be a problem with the spaces somewhere?

    I tried:
    for file in $( find -name '*.mpc' ) ; do id3v2 -d '$file' ; done

    but I got:
    (...)
    fopen: $file: id3v2: No such file or directory
    fopen: $file: id3v2: No such file or directory
    fopen: $file: id3v2: No such file or directory
    fopen: $file: id3v2: No such file or directory
    fopen: $file: id3v2: No such file or directory
    (...)

  2. #12
    Senior Member registered user
    Join Date
    May 2003
    Location
    Utrecht, The Netherlands
    Posts
    298
    - it worked
    - and I seem to understand it
    - pitty I just did remove the id3v2 tags using tag.exe for winblow$...
    - anyway, tnx for the help, it is really very much appreciated!


    grtz

    Jos

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Rar Files in Ark
    By sunpascal in forum The Lounge
    Replies: 5
    Last Post: 01-13-2010, 07:06 AM
  2. what to do with .bin files?
    By jehan60188 in forum MS Windows & New to Linux
    Replies: 2
    Last Post: 01-23-2005, 11:57 AM
  3. iso files
    By pc3 in forum General Support
    Replies: 3
    Last Post: 06-27-2004, 01:18 PM
  4. Writing to / and subdirs.
    By bikerman in forum General Support
    Replies: 1
    Last Post: 04-15-2004, 12:22 AM
  5. *.run files
    By Akurei in forum General Support
    Replies: 1
    Last Post: 03-20-2004, 05:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Samsung 4GB (1-Stick) PC4-17000 DDR4 2133 Desktop Memory RAM M378A5143EB1-CPB picture

Samsung 4GB (1-Stick) PC4-17000 DDR4 2133 Desktop Memory RAM M378A5143EB1-CPB

$9.99



DDR4 Laptop RAM 4GB 8GB 16GB 32GB 2400 2666 3200 Samsung Hynix picture

DDR4 Laptop RAM 4GB 8GB 16GB 32GB 2400 2666 3200 Samsung Hynix

$66.00



RAMAXEL Lenovo 32GB LPDDR5X CAMM2 7500MHz Laptop RAM | UNTESTED picture

RAMAXEL Lenovo 32GB LPDDR5X CAMM2 7500MHz Laptop RAM | UNTESTED

$445.00



Crucial CT16G4SFRA32A.M8FF 16GB DDR4-3200 SO-DIMM Laptop Ram Memory picture

Crucial CT16G4SFRA32A.M8FF 16GB DDR4-3200 SO-DIMM Laptop Ram Memory

$54.00



Crucial DDR3L 16GB 2 x 8GB 1600 MHz PC3L-12800 Laptop RAM Sodimm Memory 1.35V picture

Crucial DDR3L 16GB 2 x 8GB 1600 MHz PC3L-12800 Laptop RAM Sodimm Memory 1.35V

$41.00



Corsair Vengance DDR4 3200 MHz Sodimm 32 Giga (2*16) CMSX 16GX4M1A3200C22 picture

Corsair Vengance DDR4 3200 MHz Sodimm 32 Giga (2*16) CMSX 16GX4M1A3200C22

$120.00



Major Brand 8GB PC3L-12800 (DDR3-1600) 2Rx8 DDR3L SDRAM Desktop Memory picture

Major Brand 8GB PC3L-12800 (DDR3-1600) 2Rx8 DDR3L SDRAM Desktop Memory

$12.99



Hynix 8GB DDR5 4800MHz 1Rx16 PC5-38400 SODIMM Laptop Memory RAM HMCG66MEBSA092N picture

Hynix 8GB DDR5 4800MHz 1Rx16 PC5-38400 SODIMM Laptop Memory RAM HMCG66MEBSA092N

$74.99



CRUCIAL DDR4 16GB 3200 MHz PC4-25600 Laptop SODIMM Non-ECC 260-Pin Memory RAM picture

CRUCIAL DDR4 16GB 3200 MHz PC4-25600 Laptop SODIMM Non-ECC 260-Pin Memory RAM

$93.00



Micron MTC40F2046S1RC48BA1 DDR5 64GB (1x64GB) 4800MHz RDIMM ECC Server Memory picture

Micron MTC40F2046S1RC48BA1 DDR5 64GB (1x64GB) 4800MHz RDIMM ECC Server Memory

$2599.99