./zips/
a.zip - contains bla.txt , cla.txt
b.zip - contains bla.txt, cla.txt
c.zip - contains somethingelse.txt, this.xls
d.zip - contains bla.txt
... - ...
/tmp/フォルダに出力する必要があります。
a_bla.txt
a_cla.txt
b_bla.txt
b_cla.txt
c_somethingelse.txt
c_this.xls
Tried mkdir tmp
for f in *.zip; do unzip "$f" -d tmp && mv tmp/* "${f%.zip}.txt"; done
rmdir tmp
答え1
努力する:
for zip in *.zip; do bsdtar -xvf "$zip" -C /tmp -"s/^/${zip%.zip}_/"; done