Retourner au contenu associé (journal : cpio c'est mieux que tar)
Posté par Tof le 22 juillet 2010 à 12:34. En réponse au journal cpio c'est mieux que tar. Évalué à 2.
ax () { if [ $# -eq 0 ] then echo 'Gimme a file to unpack !' return fi if [ ! -x /usr/bin/atool ] then echo 'Need "atool"' return fi if [ ! -x /bin/mktemp ] then echo 'Need "mktemp"' return fi TMP=`mktemp /tmp/aunpack.XXXXXXXXXX` atool -x --save-outdir=$TMP "$@" DIR="`cat $TMP`" [ "$DIR" != "" -a -d "$DIR" ] && cd "$DIR" rm -i -rf $TMP }
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
[^] # Re: J’ajoute unp
Posté par Tof . En réponse au journal cpio c'est mieux que tar. Évalué à 2.
Et en plus (et surtout), atools évite les Tarbomb.
J'ai une fonction shell qui va bien :
ax () {
if [ $# -eq 0 ]
then
echo 'Gimme a file to unpack !'
return
fi
if [ ! -x /usr/bin/atool ]
then
echo 'Need "atool"'
return
fi
if [ ! -x /bin/mktemp ]
then
echo 'Need "mktemp"'
return
fi
TMP=`mktemp /tmp/aunpack.XXXXXXXXXX`
atool -x --save-outdir=$TMP "$@"
DIR="`cat $TMP`"
[ "$DIR" != "" -a -d "$DIR" ] && cd "$DIR"
rm -i -rf $TMP
}
Et du coup, "ax toto.tgz" extrait toto.tgz et me place dans le répertoire créé.
(oui, c'est de la flemme)