Have you tried using "$argv[1]" instead of "$1"?
2014-08-19 3:01 GMT+02:00 Martín Cigorraga :
> Hi,
> I'm trying to adapt a bash function to extract compressed files depending
> on the tool used to compress them:
>
> function ex
>
> # ex - archive extractor
>
> # usage: ex
>
>
Shouldn’t it be better to parse the result of 'file $1' for some of the
cases?
Many files start with a magic number which tells what this file is meant to
be. Of course, some formats may not have a magic number, and in the case of
*.tar.gz (or *.tgz) only the outer layer (gunzip) is detected, mean