Gadrin wrote: > I was going off of > http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1204469251779+28353475&threadId=1178036 > > The difference being the "." (dot) to match everything. However in > gnu tar, I'm able to use a single directory when I type in the > command line as I mentioned
In a regular expressoin "." matches any character but in the thread you reference "." is used in a file context not a regular expression context. In a file context "." indicates the current directory. In Unix filesystems every directory has two special entries. "." is the current directory and links to itself. ".." is the parent directory and links upward. So in the context above given to tar as a file "." means the current directory and tar will recursively travel the current directory downward archiving what it finds. This is the same as when you give tar "Top" and it recurses down that directory. Both are named directories to tar. > It creates the archive just fine, when I reference only "Top" as the > file or input argument. However the problem is that gnu tar won't > take the piped arguments from the find command to build a similar > archive. But you were not piping from find into tar. You were piping from tar into find. You were doing the opposite of what you thought you were doing. > I want to be able to "do it on the fly" meaning I don't > have to build an empty dir structure then build the archive. Sure. I tried to suggest something that might work for you. However my experience is with unix systems and not ms systems and therefore I don't know if it will actually work on your ms system. > In the meantime I've found a alternative method, which isn't so bad... > > (Just substitue Writing for Top as a folder in the following) > > J:\Temp Folders\wbtTemp>xcopy c:\writing "J:\Temp Folders\wbtTemp\writing\" > /t /e :<-- creates an empty/temporary structure Whatever you say. I don't do windows. > J:\Temp Folders\wbtTemp>tar -c -f Writing.tar writing '<-- creates an > archive of the dir structure > J:\Temp Folders\wbtTemp>tar -t -v -f Writing.tar ;<--- shows all > folders You can avoid the second pass by adding the 'v' option to the first invocation of tar. Then you would see the verbose table of contents as the archive is created and could avoid making a second pass over the data. > I was hoping there was a way to pipe the folder names to tar, but so far no > joy. Did you see my previous suggestion? bash -c "tar -c -f Test.tar `find Top -type d`" Seems like it should work to me but I can't test it on your system. Bob