Package: tar
Version: 1.13.93-4

Filenames on the commandline or read from a file via -T are not interpreted
correctly. I.e. to include the file "foo\bar" in an archive, one has to
specify "foo\\bar".

If this is intended behaviour it lacks documentation.

The attached script "doit" gave this output:
+ set -e
+ mkdir test
+ echo 1
+ echo 2
+ echo 3
+ set +e
+ tar cf test1.tar test
+ tar cf test2.tar 'test/baz\\quux' 'test/foo\bar' test/quuux
tar: test/baz\\quux: Cannot stat: No such file or directory
tar: test/foo\bar: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
+ tar cf test3.tar 'test/foo\bar' 'test/baz\\quux' test/quuux
tar: test/foo\bar: Cannot stat: No such file or directory
tar: test/baz\\quux: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
+ find test
+ tar cfT test4.tar -
tar: test/foo\bar: Cannot stat: No such file or directory
tar: test/baz\\quux: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
+ tar tvf test1.tar
drwxr-xr-x rb/rb             0 2005-02-14 10:58:09 test/
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/foo\\bar
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/baz\\\\quux
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/quuux
+ tar tvf test2.tar
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/quuux
+ tar tvf test3.tar
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/quuux
+ tar tvf test4.tar
drwxr-xr-x rb/rb             0 2005-02-14 10:58:09 test/
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/foo\\bar
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/baz\\\\quux
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/quuux
-rw-r--r-- rb/rb             2 2005-02-14 10:58:09 test/quuux
#!/bin/sh -x
set -e
mkdir test
echo 1 > 'test/foo\bar'
echo 2 > 'test/baz\\quux'
echo 3 > 'test/quuux'
set +e
tar cf test1.tar test
tar cf test2.tar test/*
tar cf test3.tar 'test/foo\bar' 'test/baz\\quux' 'test/quuux'
find test | tar cfT test4.tar -
tar tvf test1.tar
tar tvf test2.tar
tar tvf test3.tar
tar tvf test4.tar
-- 
Robbe

Reply via email to