简体   繁体   中英

Are there any unshar utility for windows?

From time to time I need to extract the contents of a shar file.

And I need to wait to have access to a *nix box to obtain the files. And I was wondering if there is a unshar utility for windows.

I can install the cygwin package but I think that is to much for only extract files from time to time.

有窗户shareutils(GNU) 在这里

A shar file is a SHell ARchive file. From The Linux Documentation Project -- file and archiving page ,

Shell archiving utility. The text files in a shell archive are concatenated without compression, and the resultant archive is essentially a shell script, complete with header, containing all the necessary unarchiving commands, as well as the files themselves. 标头,其中包含所有必要的取消归档命令以及文件本身。 Shar archives still show up in Usenet newsgroups, but otherwise shar has been replaced by tar/gzip. The unshar command unpacks shar archives.

The mailshar command is a Bash script that uses shar to concatenate multiple files into a single one for e-mailing. This script supports compression and uuencoding.

I love 7-zip , but i am not sure it can handle a shar file; will check if possible.
But, since it is a archive attached to a shell script,
you need to,

  1. cut out the archive part
    • recognize the archive format
    • use a corresponding tool to extract file (7-zip should work fine for this)

And, there is a Perl technique to do this .

Look at How do Linux binary installers (.bin, .sh) work? for some more on this.


While I talk of linux and tools here, you really do not need a Unix environment.
Perl is available on many platforms -- look at ActivePerl for example.
You can use simple installations of Cygwin , UnixUtils or, similar tools on your windows platform too.
And, 7-zip is available across all these platforms -- that's the best part of 7-zip.

Maybe there are any unshar utils because is like to make a shell interpreter.

but I solved my problem writing a little perl script that extracts the files using the cat or sed pattern and ignoring everything else.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM