Monday, March 06, 2006

OpenBSD - bzipx

Since OpenBSD don't have tar xvjf option to decompress tar.bzip2 file, I think I suppose share my user friendly bzipx script which I wrote and clean the script just by today so that it works for all the OpenBSD users as long as you have bzip2 installed. It by no mean perfect but maybe it helps people who lazy to type long commands. Here's the script -

#!/bin/ksh

# Written by geek00L[20060223] - The easy bzip2 decompression script for OpenBSD
# Revision
# 20050306 - Improved error message handling as well as bzip2 checking

if [ -f /usr/local/bin/bzip2 ]
then
echo "bzip2 is installed" > /dev/null;
else
echo "bzip2 not found, please install it via ports/packages";
exit 1

fi

Kompressed="$1"

if [ $# -ne 1 ]
then
echo "Usage : $0 compressed_file"
exit 1
fi

if [ -f $Kompressed ];
then
/usr/local/bin/bzip2 -d < $Kompressed | tar xvf -
fi

To use it, just download and put the script to /usr/local/bin, remember to chmod +x :)

shell>bzipx
Usage : /usr/local/bin/bzipx compressed_file

Decompress gaim source file .....

shell>bzipx gaim-1.5.0.tar.bz2
gaim-1.5.0
gaim-1.5.0/INSTALL
gaim-1.5.0/Makefile.in
gaim-1.5.0/gaim.desktop
gaim-1.5.0/ChangeLog
gaim-1.5.0/gaim.apspec.in
gaim-1.5.0/config.h.mingw
gaim-1.5.0/gaim.spec.in
gaim-1.5.0/install-sh
gaim-1.5.0/pixmaps
gaim-1.5.0/pixmaps/gaim_msgpend_16.ico
gaim-1.5.0/pixmaps/gaim_offline_16.ico
gaim-1.5.0/pixmaps/info.png
gaim-1.5.0/pixmaps/gaim_offline.ico
gaim-1.5.0/pixmaps/Makefile.in
gaim-1.5.0/pixmaps/send-im.png
gaim-1.5.0/pixmaps/gaim_msgunread_16.ico
gaim-1.5.0/pixmaps/msgpend.png
gaim-1.5.0/pixmaps/text_normal.png
gaim-1.5.0/pixmaps/tb_drag_arrow_right.xpm
gaim-1.5.0/pixmaps/gaim_offline_4bit_16.ico
gaim-1.5.0/pixmaps/gaim_warning.png
gaim-1.5.0/pixmaps/away.png
gaim-1.5.0/pixmaps/insert-smiley-small.png
gaim-1.5.0/pixmaps/text_smaller.png
...............

That's all for now, enjoy :]

1 comment:

Anonymous said...

thats a gr8 nifty script, they shud have bzip decompression by default.. hope will in the future system :)