I succeed to obtain the md5sum of files inside archive without using file system thanks to :
tar tjf '/home/adup/mybackup.tar.bz2' | sort | grep -v '/$' |
( while read filename;
do md5=$(tar xjOf '/home/adup/mybackup.tar.bz2' $filename | md5sum | awk '{print $1}');
echo "$md5 $filename";
done)
Unfortunately what I need is to do on a remote host over ssh like :
ssh 192.9.202.44 tar tjf '/home/adup/mybackup.tar.bz2' | sort | grep -v '/$' |( while read filename; do md5=$(tar xjOf '/home/adup/mybackup.tar.bz2' $filename | md5sum | awk '{print $1}'); echo "$md5 $filename"; done)
But like that it doesn't work, one of the tar command is interpreted locally and give me such error :
tar (child): /home/adup/mybackup.tar.bz2 : no such file
Please , is somebody can tell me how to proceed?
Thanks in advance,