[Techtalk] real life kewl text-processing and regexps samples wanted

Daniel lc-techtalk at nada.refused.cc
Sun Jan 11 21:29:27 EST 2004


On Sun, Jan 11, 2004 at 12:17:38PM -0700, Andrea Landaker wrote:
> ls -Q *.zip | xargs -n 1 unzip-createdir
> 
> here's unzip-createdir:
> 
> #!/bin/bash
> dirname="`echo $1 | sed -e 's/\.zip//'`"
> mkdir "$dirname"
> unzip -j "$1" -d "$dirname"

What about:

#!/bin/sh
for i in "$@"
do
  dirname="${i%%.zip}"
  mkdir "$dirname"
  unzip -j "$i" -d "$dirname"
done

and

unzip-createdir *.zip

						-Daniel-


More information about the Techtalk mailing list