Score:1

Any linux package that helps me deal with spaces and parenthesis in file names

in flag

i a have an ubuntu backup fileserver. I backup CAD file that are used on a windows system. needless to say the users are very generous with spaces and parenthesis in their filenames. It is a nightmare to try to rsync a file out of backup. Here is an example:

sudo rsync -a user@192.168.1.211:/media/bak/bim/daily.5/CURRENT JOBS/17/17142 Building (ECR) - 55900 EL CAMINO REAL, MENLO PARK/PRICING/FOR PRICING 02-15-2018 (BUDGET UPDATE BLDGS 1, 2, & 3)/01_Drawings/500 ECR - Office Building _2/500 ECR - B2 - BS 1.8.18 - Civil Set.pdf .

is there way to deal with such names other than by simply adding quotes since i have to escape the parenthesis as well as spaces? I was hoping there would be a package that allows linux to deal with such file names?

thanks

in flag
That kinda path almost makes me think it would be some kind of GUI, or TUI to transfer files. If you really must deal with paths, I would probably just put the path into a file, and use the `--include-from` option to select files.
Score:0
cn flag

rsync has a large number of options to control selecting files based on glob-like patterns. For example, --include-from=~/restore-pattern.txt and the file might contain new line delimited patterns with just enough to identify the files:

/media/bak/bim/daily.5/CURRENT JOBS/17/17142**02-15-2018**500 ECR - B2 - BS 1.8.18 - Civil Set.pdf

As rsync reads the file, it does not need to be safe for the shell. Note ** matches slash, which is convenient but confirm this matches only what you want.

Unfortunately, POSIX-like environments have no consistent way of doing file names correctly. See David Wheeler's Filenames and Pathnames in Shell: How to do it Correctly for the annoying details. In particular, null is the only character guaranteed to not be in a path name. Most shell scripts do not handle this, they will break in the corner case of input file names with new lines in them.

Null-separated pathnames are one way to maximize the file names accepted by tools. With GNU findutils and rysnc, could use find -print0 to write out a list of file names, then rsync --from0 --files-from= to transfer those files. When doing restores, saving the exact file list may be useful for future reference.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.