tags:

views:

24

answers:

1

I have the following working

tar -pcvf base.tar input/myPacket/my2 --exclude-vcs input/myPacket/my3/*.bmp

When i have directories with spaces like "input file" then i include the paths in quotes and the include path doesnot work for *.bmp

tar -pcvf base.tar "input file/myPacket/my2" --exclude-vcs "input file/myPacket/my3/*.bmp"

Thanks,

+1  A: 

Try this:

tar -pcvf base.tar "input file/myPacket/my2" --exclude-vcs input*file/myPacket/my3/*.bmp

Rather than try to fight the sily spaces within UNIX directories, work around it in the easiest way possible.

rlb.usa
so you mean *.bmp doesnot work, if i put in quotes?
superstar
The issue is not with `bmp` files, it's with the path. You put the `"input file/myPacket/my3/*.bmp"` originally in quotes to try and avoid the conflict with the space, right? UNIX **hates** spaces in filenames and directories. So, if your `"input file/myPacket/my3/*.bmp"` is still not working with the quotes, try the `input*file/myPacket/my3/*.bmp` version instead. The `*` is part of a regex that means "match inputfile inputxyzfile inputaa...aaafile".
rlb.usa
i was referring to *.something (eg *.bmp). I understand what you are saying. Actually my paths are dynamic, but i guess i can implement *, which is a part of regex (according to your post). Thanks man!!
superstar