Results 1 to 9 of 9

Thread: [SOLVED] Need Help With 7-Zip Extracting Script

  1. #1
    Join Date
    Jun 2008
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    [SOLVED] Need Help With 7-Zip Extracting Script

    Well, I already have a feel for 7-Zip and how to get stuff extracted, except I'm trying to simplify things with a script and do things with a script instead of always writing it out in command line.

    I want to just be able to right click on a archive file (whether it be zip, rar, 7z or whatever) open it with script, and have the script execute it & extract the file within the current subfolder that the archive file is located in... for example

    Code:
    7z x "/media/nicely/coolfiles.rar" -o"/media/nicely/coolfiles"
    is needed so everything extracts in the /coolfiles/ folder, otherwise if I omit the -o switch and just type

    Code:
    7z x "/media/nicely/coolfiles.rar"
    then everything will just go to the $HOME directory... not what I want :\

    Thus I don't always feel like typing things out in command line and just want the script to do the job after just opening file in directory... yet the only thing I can come up with is

    Code:
    #!/bin/sh
    7z x "$*"
    Which of course only extracts it to the home folder. Not sure how to have this dynamically extract to a specific folder where the archive file exists via script (for the -o switch) so any help on this would be appreciated.

  2. #2
    Join Date
    Jul 2008
    Location
    Oklahoma, USA
    Beans
    22
    Distro
    Ubuntu

    Re: Need Help With 7-Zip Extracting Script

    [Edit]
    Deleted by user.
    Last edited by ogredeschnique; August 3rd, 2008 at 06:15 PM.

  3. #3
    Join Date
    Nov 2007
    Beans
    312

    Re: Need Help With 7-Zip Extracting Script

    http://k7z.sourceforge.net/
    Install the gui for 7z.

  4. #4
    Join Date
    Jun 2008
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Need Help With 7-Zip Extracting Script

    Thanks pietjanjaap,

    It's easier to work with a GUI interface, but doesn't do anything for me when I either drag a rar file to it or try to open a file with it... so unless there's another GUI that'll be more streamline, i'll still need to come up with a script :/

  5. #5
    Join Date
    Mar 2006
    Beans
    8,345

    Re: Need Help With 7-Zip Extracting Script

    Doesn´t p7zip work like you want to?Right click on archive and select extract here.

  6. #6
    Join Date
    Apr 2005
    Location
    UK
    Beans
    3,470
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Need Help With 7-Zip Extracting Script

    Quote Originally Posted by zvacet View Post
    Doesn´t p7zip work like you want to?Right click on archive and select extract here.
    I want to ask the same thing.

    Or double click on it and open it with the archive manager.

  7. #7
    Join Date
    Jun 2008
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Need Help With 7-Zip Extracting Script

    Quote Originally Posted by kostkon View Post
    I want to ask the same thing.

    Or double click on it and open it with the archive manager.
    Thing is, the archive manager will work with many archive files, however I have a ton of .RAR archives that won't work thus me specifically using 7zip via the 7z command.

  8. #8
    Join Date
    Dec 2007
    Location
    /home
    Beans
    483

    Re: Need Help With 7-Zip Extracting Script

    I think installing rar and unrar will allow you to extract (and compress) .rar files by right clicking, or via archive-manager.
    Don't eff with The Cult...

  9. #9
    Join Date
    Jun 2008
    Beans
    43
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Need Help With 7-Zip Extracting Script

    Quote Originally Posted by angry_johnnie View Post
    I think installing rar and unrar will allow you to extract (and compress) .rar files by right clicking, or via archive-manager.
    Wow,

    Yea that sure did the trick, thanks!!!

    Guess for the mean while I'll figure out this scripting stuff as a means of killing the curiosity and eventually post that if I ever get that figured out... but as far as getting the job done of handling these rar files this works perfectly. Thanks for the help all!
    Last edited by HotDogBunToo; August 4th, 2008 at 06:51 AM.

Tags for this Thread

Bookmarks

Posting Permissions

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