Re: How to unpack iiug.org s/w downloaded files
Posted in 1998
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---559023410-684387517-901906207=:17330 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 31 Jul 1998, sanjeev sagar wrote: > I downloaded couple of files from iiug.org under > software repository. I have a question here > > How to unpack those packed files? > > If i open in view mode, they say just type 'sh > <file>' to unpack. If i do this it's give me syntax > error at line 1. I can not open these files. In other > words, i can not do any thing till they are unpack. I > am doing it on Solaris 2.5.1 > > I would appreciate if someone would let me know. You really need to get an unshar program which ignores the trash (mail headers, etc) in front of the real shell archive. Alternatively, edit the saved file, removing all the junk prior to the line starting either '#!' or ':', and save the file; then run sh on the revised file. This is what most shell archive scripts tell you to do -- see the shell archive I've attached with a copy of unshar in it -- for you to practice on! I attach the shell script I use; it hasn't failed me in quite a while. I upgraded it in 97 to read standard input; the prior change was in 1988. Yours, Jonathan Leffler (jleffler@informix.com) #include <witticism.h> Guardian of DBD::Informix v0.59 -- http://www.perl.com/CPAN Informix IDN for D4GL & Linux -- http://www.informix.com/idn ---559023410-684387517-901906207=:17330 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=unshar Content-Transfer-Encoding: BASE64 Content-ID: <Pine.GSO.3.96.980731103007.17330N@osiris.informix.com> Content-Description: unshar script : "@(#)$Id: unshar.sh,v 1.5 1997/06/02 21:45:00 johnl Exp $" # # Extracting shell archives -- even if they still have # news/mail headers on them. Also read from stdin if file name is '-'. pattern="^[:#][ !]" case $# in 0) echo "Usage: $0 file ..." >&2 exit 1 ;; esac for file in "$@" do case "$file" in '-') echo '(standard input)'; file="";; *) echo $file;; esac sed -e "1,/$pattern/ { /$pattern/p d }" $file | sh done exit 0 ---559023410-684387517-901906207=:17330 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="unshar.sa" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.GSO.3.96.980731103007.17330O@osiris.informix.com> Content-Description: shell archive containing unshar script : "@(#): shar.sh,v 2.1 1998/06/02 17:13:43 jleffler Exp $" #! /bin/sh # # This is a shell archive. # Remove everything above this line and run sh on the resulting file. # If this archive is complete, you will see this message at the end: # "All files extracted" # # Created on: Fri Jul 31 10:28:53 PDT 1998 # Created by: jleffler at Informix Software Inc. # # Files archived in this archive: # unshar # #-------------------- if [ -f unshar -a "$1" != "-c" ] then echo shar: unshar already exists else echo 'x - unshar (452 characters)' sed -e 's/^X//' >unshar <<'SHAR-EOF' X: "@(#)$Id: unshar.sh,v 1.5 1997/06/02 21:45:00 johnl Exp $" X# X# Extracting shell archives -- even if they still have X# news/mail headers on them. Also read from stdin if file name is '-'. X Xpattern="^[:#][ !]" X Xcase $# in X0) echo "Usage: $0 file ..." >&2 X exit 1 X ;; Xesac X Xfor file in "$@" Xdo X case "$file" in X '-') echo '(standard input)'; file="";; X *) echo $file;; X esac X sed -e "1,/$pattern/ { X /$pattern/p X d X }" $file | X sh Xdone Xexit 0 SHAR-EOF chmod 545 unshar if [ `wc -c <unshar` -ne 452 ] then echo shar: unshar unpacked with wrong size fi # end of overwriting check fi echo All files extracted exit 0 ---559023410-684387517-901906207=:17330--