Any help?
"DT" <o...@sinaman.com> 在郵件 news:bh5o2v$hb...@imsp212.netvigator.com 中撰寫
...
Ben
tar: !test.exclude.file: A file or directory in the path name does not
exist.
Why did you think that would work? You must be using some version of
tar that I don't have...
-dwiv (CATE/AIX)
I'm guessing you'll just have to do a find and pipe it to a grep -v,
then pipe that to tar -cvf -
Chris
Stop guessing and RTFM. Pay attention to that AIX version of tar supports
the -L option so:
- Write a file containing the list of files to backup
- Run the AIX tar thus:
tar -c -v -f tarfile.tar -L filelistfile
GNU tar has similar options but with a different name so again: RTFM, this
time the manual for GNU tar.
Villy
Strangely enough I didn't just sit and think it would work, I KNOW it works
as I use it every day on both Solaris and AIX. See below :
# tar cvf tarfile.tar !(file1)
a file2 0K
# tar tvf tarfile.tar
tar: blocksize = 3
-rw-r--r-- 0/1 0 Aug 15 15:20 2003 file2
Ben
Its a shell expansion and NOT a tar option.
So !(a) will be expanded by the shell and then passed to tar. I do not know
if every shell support the "!(FILE)" expansion
Example
(0)ffzn0xf3:/tmp/x 372$ set -x
(0)ffzn0xf3:/tmp/x 372$ ls
+ ls
a b c d
ffzn0xf3:/tmp/x 371$ echo !(a)
+ echo b c d
b c d
HTH
Hajo
CATE AIX/RS6000
Ah! That makes more sense... and, the original example used curly
braces, so I didn't catch on.
That works in KSH.
> So !(a) will be expanded by the shell and then passed to tar. I do not know
> if every shell support the "!(FILE)" expansion
>
> Example
> (0)ffzn0xf3:/tmp/x 372$ set -x
>
> (0)ffzn0xf3:/tmp/x 372$ ls
> + ls
> a b c d
>
> ffzn0xf3:/tmp/x 371$ echo !(a)
> + echo b c d
> b c d
Yup...test works just as described, using KSH on AIX.
Thanks for clearing that up! There are significant differences with {
and (, you see... :)
-dwiv (CATE/AIX)
Wow about a month ago I was looking for this very option. Thank you
for sharing the knowledge. I am curious however, will this work for
directories as well? And, what if you wanted to exclude multiple
files is there a particular syntax?
KB