Code: Select all
#!/bin/bash
${1}.tar=$tarred
echo $tarred
Code: Select all
tarzip: 3: tarzip: .tar=: not found
Update: Fixed it, and completed script. Here it is for your own use, if you find it helpful.
Code: Select all
#!/bin/bash
${1}.tar=$tarred
echo $tarred
Code: Select all
tarzip: 3: tarzip: .tar=: not found
Hi @StevenC21
$tarred
is empty. I think you have the assignment round the wrong way.Code: Select all
#!/bin/bash
tarred="$1.tar"
echo $tarred
Code: Select all
tar -cjf dir.tar.bz2 dir
Code: Select all
BZIP2="--best -v" tar -cjf dir.tar.bz2 dir
Code: Select all
tar -I "bzip2 --best -v" -cf dir.tar.bz2 dir
Code: Select all
tar -c dir | bzip2 --best -v >dir.tar.bz2
Code: Select all
tar -c dir | tee dir.tar | bzip2 --best -v >dir.tar.bz2