Miscellaneous stuff for deco users
Extractor wrappers
- deco-diskimage is Zoë Stephenson’s collection of extractor wrappers for filesystem disk images.
A handy shell snippet
Add the following code to your POSIX-compatible shell’s initialization file, ~/.bashrc in the case of bash:
dcd()
{
while getopts ace:uv __dcd_out "$@" 2>/dev/null; do :; done
test $OPTIND = $# || { deco "$@"; return; }
__dcd_out=`deco "$@"; ret=$?; printf .; exit $ret`
__dcd_ret=$?
__dcd_out=${__dcd_out%.}
case $__dcd_out in
*/?) cd -- "${__dcd_out%?}" && ls ;;
*?) printf %s "$__dcd_out" ;;
esac
eval unset __dcd_out __dcd_ret\; return $__dcd_ret
}
You can then e. g. run dcd -u archive.tar to extract then unlink archive.tar and, if applicable, cd into (presumably) archive/ and call ls.
Note that deco 1.6 or later is needed for this to work.