Re: [SLE] Bash scripting help



Jim Cunning wrote:

On Sat, 2005-12-03 at 09:55, David Crouch wrote:


HI all.

I used to know how to do this, but apparently I've forgotten :( I know
I can use a for loop to process all the files in a directory, but I
can't for the life of me remember how to do it. I have a bunch of
archived files that I want to unarchive. I've tried for I in *rar:do
'unrar x $I.rar':done, but that doesn't work and I can't seem to find
the right man page with the syntax. Any help?



for f in *rar; do unrar x $f; done

See 'man bash' then enter '/^\s*for/ and n (next) until you find the
explanation you want.


I tried both your version and Lawrence's and have the same problem. My rar files have spaces in them and I think that is the problem. The script is only pulling the first word before the spaces.

-David

--
Check the headers for your unsubscription address
For additional commands send e-mail to suse-linux-e-help@xxxxxxxx
Also check the archives at http://lists.suse.com
Please read the FAQs: suse-linux-e-faq@xxxxxxxx



Relevant Pages

  • Re: [SLE] Bash scripting help
    ... > I can use a for loop to process all the files in a directory, ... > archived files that I want to unarchive. ... > 'unrar x $I.rar':done, but that doesn't work and I can't seem to find ... Prev by Date: ...
    (SuSE)
  • [SLE] Bash scripting help
    ... I can use a for loop to process all the files in a directory, ... archived files that I want to unarchive. ... Check the headers for your unsubscription address ... Prev by Date: ...
    (SuSE)
  • Re: [SLE] Bash scripting help
    ... (assumes BASH) ... I can use a for loop to process all the files in a directory, but I can't for the life of me remember how to do it. ... I have a bunch of archived files that I want to unarchive. ...
    (SuSE)
  • Is it possible to "search" archived dtata?
    ... I am intending to write a script to archive my Sharepoint data. ... What I need to know is, after moving the archived files to a file ...
    (microsoft.public.sharepoint.windowsservices)
  • Is it possible to search archived data?
    ... I am intending to write a script to archive my Sharepoint data. ... What I need to know is, after moving the archived files to a file ...
    (microsoft.public.sharepoint.portalserver)

Loading