Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Declined Parse filenames that have embedded spaces

Apr
5
0
Having to pre-process filenames that have embedded spaces in order to do a move or copy is annoying. It shouldn't be difficult for the shell to parse them correctly (I mean, Microsoft does it, so how hard can it be?)
 
Having to pre-process filenames that have embedded spaces in order to do a move or copy is annoying. It shouldn't be difficult for the shell to parse them correctly (I mean, Microsoft does it, so how hard can it be?)

Not hard at all. Just use double quotes around any filename that contains spaces, or that might contain spaces.
 
Having to pre-process filenames that have embedded spaces in order to do a move or copy is annoying. It shouldn't be difficult for the shell to parse them correctly (I mean, Microsoft does it, so how hard can it be?)

Microsoft (i.e., CMD.EXE) does it the same way as TCC / TCMD, by putting double quotes around the filenames. When a command accepts multiple arguments, it's beyond the scope of a command line parser's abilities to decide when a space is a delimiter and when it isn't.
 
Microsoft (i.e., CMD.EXE) does it the same way as TCC / TCMD, by putting double quotes around the filenames. When a command accepts multiple arguments, it's beyond the scope of a command line parser's abilities to decide when a space is a delimiter and when it isn't.

I wasn't really thinking of cmd.exe since with tc I rarely have a need for it, but rather the explorer or whatever its name is. It gets away with it because it already knows what the paths and filenames are (I thought tc was going to have a similar interface, actually--I still don't know what the functional diffs are between 4nt and tc).

But a cli like tc can figure things out 80% of the time or more by looking at the disc. It would slow things down by one or more extra reads, but a lot of that overhead could be reduced heuristically by caching the pointless embeddings that we get from Microsoft for our inconvenience ("Program Files", etc). When it can't figure it out, do what tcsh does: ask.
 
If you use tab completion, TCC (or CMD.EXE, for that matter) will pick up the filename from the disk and add quotation marks as needed. Get into the habit of using the Tab key; it saves a whole lot of typing and reduces errors, too.
 
Back
Top