I have some directories with a varying numbers of files and subdirectories. All files that have no extensions have to be tared. Their names may change, thus they can not be hardcoded. Subdirectories may also contain a unspecified number of files and subdirectories that are not relevant and should not be included in the archive.
I'd like to be able to do this with a single line, not using any .sh scripts, so that this process could be reproduced as portably as possible.
Sample directory structure:
$ ls -1F
bar-dir/
bar.with.dots
foo-directory/
foo-no-ext
quux.dir/
quux.ext
The resulting tar should contain only foo-no-ext in this case.
The closest I've come up with this far is
tar -cf archive.tar --exclude=*.* --no-recursion *
But, when executed on the sample set, the archive.tar still includes the subdirectories (even though empty):
$ tar -tf archive.tar
bar-dir/
foo-directory/
foo-no-ext

bashorperlis exactly the same on all systems, whiletarmay be GNU, BSD, Solaris tar... – grawity Sep 1 '11 at 18:33