i'm an extremely lazy admin.

so, i have this list of 7zipped files in a directory, right?

i want to loop through and unzip them all into their own folders. this echo works.

for z in *.7z ; do echo "7z x \"$z\" -o\"`basename "$z" .7z`\"" ; done
7z x "my zip.7z" -o"my zip"
7z x "my zip 2.7z" -o"my zip 2"
7z x "my zip 3.7z" -o"my zip 3"

but when i try it without, bash likes to toss some errors my way.

`for z in *.7z ; do "7z x \"$z\" -o\"`basename "$z" .7z`\" ; done`       
bash: 7z x "my zip.7z" -o"my zip": command not found

so instead of trying to dig further into the problem, i copied the outputted echo into my buffer, ran screen, pasted, and detached.

the neckbeard in me wants to find a proper way of doing this; the lazy coder in me is satisfied with having a functional answer.

comments powered by Disqus