APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Plenty of space here


© October 2009 Anthony Lawrence

"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.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> Plenty of space here

1 comment


Inexpensive and informative Apple related e-books:

Take Control of Upgrading to El Capitan

Take Control of Numbers

Take control of Apple TV, Second Edition

Take Control of IOS 11

Take Control of OS X Server




More Articles by © Anthony Lawrence






Wed Oct 21 19:59:51 2009: 7331   MikeHostetler

gravatar
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.




------------------------


Printer Friendly Version

Have you tried Searching this site?

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.

Contact us


Printer Friendly Version





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)




Linux posts

Troubleshooting posts


This post tagged:

Linux

Shell



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode





SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com