Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    newb bash scripting


    Please dont laught at me for posting this

    Ok so i downloading stuff over newsserver using
    so i get lots of .rar .r00 ... to unrar then to sort and to delete so i *tryied* to make a script to unrar , then delete the rars and finally to move the .avi to a folder . It works great when i have one movie to decompress but when there is more than one stuff to unrar it messes up.

    Anyway there is my code :
    # unrar - delete - sort
    cd $NZB_DIR
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    $RAR_DIR/unrar e *.part01.rar
    $RAR_DIR/unrar e *.rar
    rm -f $NZB_DIR/*.r*
    rm -f $NZB_DIR/*.par2
    rm -f $NZB_DIR/*.PAR
    rm -f $NZB_DIR/*.PAR2
    rm -f $NZB_DIR/*.nfo
    rm -f $NZB_DIR/*.NFO
    rm -f $NZB_DIR/*.sfv
    rm -f $NZB_DIR/*.SFV
    mv *.avi $FILM_DIR
    mv *.nzb $NZBD_DIR
    echo Finit
    It is my first script please keep that in mind lol
    thanks in advance

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    South America
    What exactly do you mean "it messes up", I mean, doesnt it decompresses whatcha need or something?

  3. #3
    the thing is that it decompresses the first movie.then instead of doing the second one it does the first one again and then its removes all the rars so i loose the cd2.
    it thought unrar e *.part01.rar would do the first one and then the seconde one but it doesnt seem to work that way...

  4. $spacer_open

Posting Permissions

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