LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-04-2004, 03:54 PM   #1
JonCooperUK
LQ Newbie
 
Registered: Mar 2004
Posts: 28

Rep: Reputation: 15
Bash scripting


Hi all,

I'd like to be able to create a bash terminal script that will convert an ace compressed archive to a rar. Is this possible? Something that works like:

ace2rar myfile.ace myfile.rar

Thanks in advance for any pointers
 
Old 03-04-2004, 05:24 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
I'd like to be able to create a bash
terminal script that will convert an
ace compressed archive to a rar.
Is this possible?
Yes ;}

Of course you need to buy both programs ...


Cheers,
Tink
 
Old 03-04-2004, 08:16 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
I've never heard of an ace archive. Do you have a program that will uncompress such an archive? You can download a tarball for rar on the net and compile it. Then your script will take the two parameters and use them in a line which pipes the stdout of the ace decompressor and pipes it into rar. If you look at the man pages for rar, tar and cpio, they should supply models you could build on to write your script.

Your hardest part may be in error correction. You might want to use the 'file' command to verify the the file input is an .ace or .rar file before attempting to perform the conversion.

You could write the stript to be able to convert either way and check $0 to see if it was called as ace2rar or rar2ace or ace2tgz, whatever. Then use the case selector to perform the conversion needed.
 
Old 03-04-2004, 08:55 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally posted by jschiwal
I've never heard of an ace archive. Do you have a program that will uncompress such an archive?
Winace http://www.winace.com is a pretty good
windows compression tool ...


Thing is that both ace and rar only have free
UN-archivers for Linux for all I know, which makes
the tool quite hard to implement, I guess :}

maybe two scripts, ace2bz2 and rar2bz2? ;)


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash scripting help (su ...) shwong Linux - General 1 11-02-2005 12:26 PM
Bash scripting pete1234 Programming 1 09-27-2005 01:48 AM
bash scripting vadon Linux - Newbie 6 05-10-2005 04:07 AM
need help with bash scripting rich2oo1 Programming 2 12-17-2003 12:50 PM
HELP with BASH scripting atwah Linux - Newbie 6 09-09-2003 01:10 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration