help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] bash 4.3 escaping : (breaking script), unlike 4.2. Huh?


From: B. S.
Subject: Re: [Help-bash] bash 4.3 escaping : (breaking script), unlike 4.2. Huh?
Date: Sun, 23 Oct 2016 19:59:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0

Thanks!

Would never have found this, let alone with such efficiency!

Worst case, current code of if later bash (which I guess I should change to if later tar), of:

mytocommands=blah

# inserted code
if later bash {
  myshfile=mktemp
  echo $mytocommands > $myshfile
  mytocommands=myshfile
}

Letting me leave 'tar -to-command=$mytocommands' alone, works.

I expect I'll try mytocommands="bash blah", but otherwise won't waste further eyespace on this - I've been hunting this wumpus for many hours and several days now. (Saying to myself "It shouldn't be THIS hard!" several times along the way.)


* Thanks to everyone for having this list, and it being so responsive! A few minutes here, some patience == a faster path to resolution than all the time I spent hunting prior.


On 10/23/2016 07:41 PM, Eduardo Bustamante wrote:
OK, so the assumption here is that your interactive shell is Bash.
Nothing has changed in bash that would cause the escaping that you're
seeing. Bash passes the arguments unmodified to GNU tar (another
assumption is that you're running system's tar, which in Ubuntu 14.04
is GNU tar 1.27.1-1 [1]).

Reading through the commit logs in GNU tar code repository, you can
find the following commit:

     hp% PAGER=cat git show 61cd3f
     commit 61cd3fd26855d40ee3a6491b2aa3611cd2aae46c
     Author: Sergey Poznyakoff <address@hidden>
     Date:   Thu Apr 14 11:51:38 2016 +0300

         Fix argument handling when running external commands.

         * src/system.c (xexec): Use sh -c to run the command.  This fixed
         bug introduced by 7b5e80396 (tar 1.27)
         * doc/tar.texi: Fix checkpoint examples: (1) $TAR_FILENAME
         is not available when creating archive and (2) --checkpoint
         can't be used as abbreviation of --checkpoint-action
     [...]

If you inspect the patch for src/system.c [2], you'll realize that
this was fixed after version 1.27. I'm not sure what the best option
is here, but you need to upgrade your tar command.

More links to read:

- Re: [Bug-tar] How one can do untar a file and gzip
its files with one command line?
http://osdir.com/ml/bug-tar-gnu/2016-04/msg00011.html


[1] http://packages.ubuntu.com/trusty/tar
[2] 
http://git.savannah.gnu.org/cgit/tar.git/commit/?id=61cd3fd26855d40ee3a6491b2aa3611cd2aae46c




reply via email to

[Prev in Thread] Current Thread [Next in Thread]