
raphaskin
(usa Fedora)
Enviado em 12/11/2015 - 10:37h
Olá bom dia,
Estou com um problema para descompactar vários arquivos em um diretório.
Os arquivos estão em um formato .bz2
E o script é o seguinte:
#!/bin/bash
DESTINO="/home/raphael"
TAR="/bin/tar"
LS="/bin/ls"
cd $DESTINO
while read u; do
$TAR -jxf $DESTINO/$u -C $DESTINO/
done < <(/bin/ls -1 $DESTINO)
Ocorre o seguinte erro:
tar (child): /raphael/postgres.sql.tar.bz2: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
/bin/tar: Child returned status 2
/bin/tar: Error is not recoverable: exiting now
Obs. Se eu rodo o comando manualmente, eu consigo descompactar normalmente.
/bin/tar -jxf /raphael/postgres.sql.tar.bz2 -C /raphael/
Desde já, eu agradeço.