i have issue with tar, let me explain
when i run below command it works perfectly as usual.
tar -cvf /tmp/temp.tar --exclude="exclusion expression" dir
my requirement is
--exclude="exclusion expression"
will come from another variable.
so when i execute below command:
tar -cvf /tmp/temp.tar "$patern" dir
it interprets it as
tar -cvf /tmp/temp.tar '--exclude="exclusion expression" ' dir
see it adds extra single quotes and command fails.
anybody please help, i hope its very easy.
i tried using sed and removing single quote from variable but that not the problem as soon as i give here as parameter to tar command it gets converted same.