"Type ess-see-pee-SPACE-john-ATSIGN-192-DOT". The person at the other end of the phone line interrupted me: "Hold on, I typed an extra space".
"You mean before 'john''?", I asked, "That doesn't matter".
"Why doesn't it matter? It always has", he asked, obviously confused.
I could understand that. Like many people, my customer doesn't understand spaces in command lines. Unlike most, he's not one to leave spaces out - no, he's more likely to insert gratuitous spaces where none are wanted. For example, in an earlier "scp" command, he had added a space after "john". I had chastened him not to add any spaces unless I specifically said to, so it seemed reasonable to him to think that two spaces in a row would also be an error. I needed to explain that multiple spaces would be ignored, indeed not even seen by "scp".
His confusion is easier to understand than that of people who leave spaces out. I understand that part of that came from DOS. Being able to do things like "DIR/P" created a lot of this. But can that really be responsible for all of it? Many people today might have never, ever used a DOS command line - why would spaces still confuse them?
Putting a space after "john" isn't illogical. The "scp" command could have been written to parse the user name as a separate argument. You'd probably need "to" and "from" to specify the direction of the copy; you'd type things like "scp /tmp/foo from 192.168.7.2 john /tmp/foobar" and change "from" to "to" if you needed to go the other way. Some people might find that less confusing than the present syntax.
But if our goal is to not confuse users, maybe we shouldn't have command line arguments at all? Our user would type "scp", press enter, and the program itself would ask the appropriate questions. For a command like "scp", which is meaningless without additional parameters, it wouldn't be difficult to design it to act on any supplied arguments and prompt if none were offered. Interfaces like that are hardly without precedent, but few Unix/Linux commands bother to do that, simply because it's not so easy to do. Take a refresher look at "man scp" and think about how many questions you'd need to ask!
Spaces will continue to confuse for as long as there are command lines. I'll be intoning "ess-see-pee-SPACE-john-ATSIGN-192-DOT" for at least a few more years.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2009-11-07 Anthony Lawrence
Unlike info, pinfo does not display anything if it has nothing. I've been forever irritated by info coming up with its default page when it has nothing to tell me. (Tony Lawrence)