removido
(usa Nenhuma)
Enviado em 27/03/2018 - 15:30h
msoliver escreveu:
#!/bin/bash
log="/tmp/relatorio.txt"
exec 3< <(ls)
while read ARQ <&3; do
echo \"${ARQ// /\\ }\"
unzip -n "${ARQ// /\\ }\"; 2> $log
rm "${ARQ// /\\ }\" 2>> $log
done
exec 3<&-
exit 0
$ cat /tmp/relatorio.txt
unzip: cannot find or open Book\ Antiqua.zip"; 2> /tmp/relatorio.txt
rm Book\, Book\ Antiqua.zip"; 2> /tmp/relatorio.txt
rm Book\.zip or Book\ Antiqua.zip"; 2> /tmp/relatorio.txt
rm Book\.ZIP.
unzip: cannot find or open Century\ Schoolbook\ L\ Regular.zip"; 2> /tmp/relatorio.txt
rm Century\, Century\ Schoolbook\ L\ Regular.zip"; 2> /tmp/relatorio.txt
rm Century\.zip or Century\ Schoolbook\ L\ Regular.zip"; 2> /tmp/relatorio.txt
rm Century\.ZIP.
unzip: cannot find or open Gabriele.afm"; 2> /tmp/relatorio.txt
rm Gabriele.afm", Gabriele.afm"; 2> /tmp/relatorio.txt
rm Gabriele.afm".zip or Gabriele.afm"; 2> /tmp/relatorio.txt
rm Gabriele.afm".ZIP.
unzip: cannot find or open George\ Harrison.ttf"; 2> /tmp/relatorio.txt
rm George\, George\ Harrison.ttf"; 2> /tmp/relatorio.txt
rm George\.zip or George\ Harrison.ttf"; 2> /tmp/relatorio.txt
rm George\.ZIP.
unzip: cannot find or open VTKS\ ROCK\ GARAGE\ BAND.zip"; 2> /tmp/relatorio.txt
rm VTKS\, VTKS\ ROCK\ GARAGE\ BAND.zip"; 2> /tmp/relatorio.txt
rm VTKS\.zip or VTKS\ ROCK\ GARAGE\ BAND.zip"; 2> /tmp/relatorio.txt
rm VTKS\.ZIP.
unzip: cannot find or open script.sh"; 2> /tmp/relatorio.txt
rm script.sh", script.sh"; 2> /tmp/relatorio.txt
rm script.sh".zip or script.sh"; 2> /tmp/relatorio.txt
rm script.sh".ZIP.
$ bash -x script.sh
+ log=/tmp/relatorio.txt
+ exec
+ read ARQ
++ ls
+ echo '"Book\' 'Antiqua.zip"'
"Book\ Antiqua.zip"
+ unzip -n 'Book\ Antiqua.zip"; 2> /tmp/relatorio.txt
rm Book\' 'Antiqua.zip"'
+ read ARQ
+ echo '"Century\' 'Schoolbook\' 'L\' 'Regular.zip"'
"Century\ Schoolbook\ L\ Regular.zip"
+ unzip -n 'Century\ Schoolbook\ L\ Regular.zip"; 2> /tmp/relatorio.txt
rm Century\' 'Schoolbook\' 'L\' 'Regular.zip"'
+ read ARQ
+ echo '"Gabriele.afm"'
"Gabriele.afm"
+ unzip -n 'Gabriele.afm"; 2> /tmp/relatorio.txt
rm Gabriele.afm"'
+ read ARQ
+ echo '"George\' 'Harrison.ttf"'
"George\ Harrison.ttf"
+ unzip -n 'George\ Harrison.ttf"; 2> /tmp/relatorio.txt
rm George\' 'Harrison.ttf"'
+ read ARQ
+ echo '"VTKS\' 'ROCK\' 'GARAGE\' 'BAND.zip"'
"VTKS\ ROCK\ GARAGE\ BAND.zip"
+ unzip -n 'VTKS\ ROCK\ GARAGE\ BAND.zip"; 2> /tmp/relatorio.txt
rm VTKS\' 'ROCK\' 'GARAGE\' 'BAND.zip"'
+ read ARQ
+ echo '"script.sh"'
"script.sh"
+ unzip -n 'script.sh"; 2> /tmp/relatorio.txt
rm script.sh"'
+ read ARQ
+ exec
+ exit 0
$ ls -1
Book Antiqua.zip
Century Schoolbook L Regular.zip
Gabriele.afm
George Harrison.ttf
VTKS ROCK GARAGE BAND.zip
script.sh