home *** CD-ROM | disk | FTP | other *** search
/ Executor 2.0 / executorv2.0.iso / pc / linux / extra / docs / maillist / text / archive.96 / text2990.txt < prev    next >
Encoding:
Text File  |  1996-07-25  |  1.5 KB  |  54 lines

  1. >>>>> "V" == Vincent Cojot <coyote@step.polymtl.ca> writes:
  2.  
  3. V> My command line looks like (it's a short example in which I am
  4. V> trying to backup .../ExecutorVolume/Programs/Execl 4.0 to show the
  5. V> problem):
  6.  
  7. V> palanthas:~$ tar --null -cvzf /tmp/test.tgz
  8. V> /usr/local/lib/executor/ExecutorVolume/Programs/Ex*
  9.  
  10. As far as I can tell, this is not a problem with tar.  I bet if you
  11. issue the command
  12.  
  13. tar --null -cvzf /tmp/test.tgz \
  14.   /usr/local/lib/executor/ExecutorVolume/Programs
  15.  
  16. you'll have no problems.  The problem you are having is not with tar,
  17. but with file name expansion done by the shell.  When you say
  18. something like 
  19.  
  20. somedir/Programs/Ex*
  21.  
  22. The shell expands it into soemthing like 
  23.  
  24. somedir/Programs/Excel 4.0 SomeFile somedir/Programs/Excel 4.0 AnotherFile
  25.  
  26. and hands this to tar on its command line.  Note that tar sees this
  27. line as 6 files (listed below separated by newlines for clarity): 
  28.  
  29. stuff/Programs/Excel
  30. 4.0
  31. SomeFile
  32. stuff/Programs/Excel
  33. 4.0
  34. AnotherFile
  35.  
  36. using --null doesn't help here because the program feeding the names
  37. to tar, the shell, isn't using null termination.  I'm not even sure it
  38. does what you want since --null is mostly meant for use with the
  39. --files-from option.
  40.  
  41. So, how do you fix it?  One option is to not use the shell for
  42. filename expansion.  Instead use find.  You could get essentially the
  43. same effect with find and tar like this:
  44.  
  45. find /usr/local/lib/executor/ExecutorVolume/Programs --name "Ex*" \
  46.   -print0 | tar --null --files-from - czf /tmp/test.tgz
  47.  
  48. I think that's right...
  49.  
  50. Anyway, good luck.
  51. --
  52. Rob
  53.  
  54.