[cat command] | grep [dir_name] | [rest of command]
For tar archives
tar -tvf /dev/rmt0 > /tmp/toc
vi /tmp/size.script
#!/bin/ksh summ=0 for i in `cat /tmp/toc | awk '{print $4}'` do ((summ=summ + i)) done ((summ=summ / 512)) echo "Size in 512 byte blocks="$summ
chmod 744 /tmp/size.script
/tmp/size.script
Once the script completes, a number in 512 byte blocks should be displayed. This is the amount of space used by the restored files. Create the file system a little larger than the output.
For cpio archives
cpio -itcvB </dev/rmt0 >/tmp/toc
#!/bin/ksh summ=0 for i in `cat /tmp/toc |awk '{gsub ("^0", "512",$3); print $3}'` do ((summ=summ + i)) done ((summ=summ / 512)) echo "Size in 512 byte blocks="$summ
For backup/restore
restore -Tqvf /dev/rmt0 >/tmp/toc
#!/bin/ksh summ=0 for i in `cat /tmp/toc |grep -v The |awk '{gsub ("^0", "512",$1); print $1}'` do ((summ=summ + i)) done ((summ=summ / 512)) echo "Size in 512 byte blocks="$summ
[ Doc Ref: 9563482332168 Publish Date: Apr. 28, 2000 4FAX Ref: none ]