9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: arisawa@ar.aichi-u.ac.jp
To: 9fans@cse.psu.edu
Subject: Re: [9fans] netpbm
Date: Fri,  4 Feb 2005 18:03:37 +0900	[thread overview]
Message-ID: <b2da39b219e257552a7fec6ad458ffc3@ar.aichi-u.ac.jp> (raw)
In-Reply-To: <d247a5c4c10977b61b46e6ec39d28847@ar.aichi-u.ac.jp>

Mine is
#!/bin/rc -e
# unpack file ...
#   foo.gz   -> foo          in case of file.
#   foo.tar.gz   -> foo      in case of dir.
#   foo. -> DO NOTHING
#   foo  -> DO NOTHING
#
# coded by Kenar
#
fn usage {
	echo 'usage: unpack  file ...'
	exit usage
}

fn error {
	echo $*
	exit 'not found'
}

if(~ $#* 0) usage

while (! ~ $#* 0 ){
	x = $1
	if (test ! -e $x) error file $x not found
	f = 1
	while(~ $f 1){
	switch($x){
	case *.gz
		gunzip $x
		x=`{basename $x .gz}
	case *.tgz
		gunzip $x
		x=`{basename $x .tgz}^.tar
	case *.tar
		tar -xf $x
		echo rm $x
		x=`{basename $x .tar}
	case *.bz2
		bunzip2 $x
		x=`{basename $x .bz2}
	case *.tbz
		bunzip2 $x
		x=`{basename $x .tbz}^.tar
	case *.tbz2
		bunzip2 $x
		x=`{basename $x .tbz2}^.tar
	case *
		f=0
	}
	}
	shift
}

More decoding methods should be added.
And I rarely uses execept gzip.
Therefore not so much debugged.

Kenji Arisawa


  reply	other threads:[~2005-02-04  9:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-04  5:45 tapique
2005-02-04  7:00 ` arisawa
2005-02-04  7:17   ` Lucio De Re
2005-02-04  8:06     ` geoff
2005-02-04  9:06       ` Lucio De Re
2005-02-04  9:13       ` Lucio De Re
2005-02-04 21:38       ` boyd, rounin
2005-02-05  1:35         ` geoff
2005-02-05  1:41           ` andrey mirtchovski
2005-02-05  1:45             ` geoff
2005-02-05  1:47             ` geoff
2005-02-05  6:19         ` Bruce Ellis
2005-02-04  8:52     ` arisawa
2005-02-04  9:03       ` arisawa [this message]
2005-02-04  9:16         ` Lucio De Re
2005-02-04 14:07           ` arisawa
2005-02-04 14:32             ` Sam
2005-02-04 15:54               ` andrey mirtchovski
2005-02-07  6:57                 ` Lucio De Re
2005-02-04  9:31       ` C H Forsyth
2005-02-04  9:33         ` Tiit Lankots
2005-02-04 16:47         ` Derek Fawcus
2005-02-04 16:49           ` Ronald G. Minnich
2005-02-04 16:52             ` Charles Forsyth
2005-02-04 21:45           ` boyd, rounin
2005-02-04 22:02             ` Ronald G. Minnich
2005-02-04 22:08               ` boyd, rounin
2005-02-05 18:26         ` [9fans] factotum & invalid entries Tiit Lankots
2005-02-05 20:12           ` Russ Cox
2005-02-04 12:32 ` [9fans] netpbm arisawa
2005-02-04 14:00   ` arisawa
  -- strict thread matches above, loose matches on Subject: below --
2005-02-10 15:24 tapique
2005-02-10 14:26 tapique
2005-01-27 12:40 cej

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b2da39b219e257552a7fec6ad458ffc3@ar.aichi-u.ac.jp \
    --to=arisawa@ar.aichi-u.ac.jp \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).