"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.
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Wed Oct 21 19:59:51 2009: Subject: MikeHostetler
http://www.squarepegsystems.com
One of the many systems I have been exposed to over the years did exactly what you suggested at the end of this article. The Stratus VOS platform let you type in the name of a command, hit F2 or some other key and it would pop open all the arguments and you just fill in the blanks and hit enter.
The closest I've seen to this in the Unix world is zsh's completion. Bash has tried to mimic it with the bash_completion project but it doesn't work nearly as well.
With zsh, I can type "scp " and hit tab, and a menu of hosts I've connected to before along with files in the current directory. I choose a host, type "/" and his tab again and, assume I have my keys setup correctly, zsh offers me directories on the remote host.
I could go and on, but suffice to say that zsh is my shell of choice. And I listed a few of the reasons here.
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar