USERNAME

Andrew Sayers andrew-bugs.launchpad.net at pileofstuff.org
Wed Jul 22 19:32:36 UTC 2009


Whenever possible, I think it's best to reduce scripts to something that 
can be run directly.  Users that don't understand the shell are likely 
to just save the script and treat it like a black box, whereas those 
that care will go and do the reading.  As such, I don't see that 
consistency is that important here.

There will always be places that require user interaction though.  For 
example, you can't convert "ssh <user>@<hostname>" to "ssh 
$USER@$HOSTNAME".  I think angle brackets are the best approach here, 
because they're widely used elsewhere, and because it's easy to put <as 
many words as you need> between angle brackets.  I agree that there will 
be a certain rate of attrition with angle brackets, but no more so than 
any other solution.  I would actually expect "$TYPE_YOUR_HOSTNAME_HERE" 
to create more attrition, because scripts that use $USER, $HOME etc. 
will train users to ignore all instances of $SHOUTING.

I've been helping out lately with a Firefox add-on that solves a related 
problem, and I'm thinking about folding in a solution for this problem. 
  My portion of the idea last passed through here as "terminal 
tutorials" a couple of months ago, and isn't really due back for another 
couple of weeks, but it's relevant to this conversation, so I'll explain 
my current thinking.

The add-on is called TerminalRun, and the current version is here:

https://addons.mozilla.org/en-US/firefox/addon/9738

The other guy working on the program is busy this week, so we haven't 
talked about whether this is really feasible, but I've been thinking 
about adding hints and warnings for worrisome bits of script.  I've 
attached a screenshot, showing what TerminalRun might do with 
https://help.ubuntu.com/community/SSH/OpenSSH/ConnectingTo

This add-on provides a one-click solution for shell scripts in most 
cases, and I propose to show the window from the screenshot when the 
add-on sees something like angle brackets, sudo, wget, etc.

Once this add-on matures, I'd like to recommend it quite widely, which 
would IMHO significantly improve the newbie experience of shell scripts, 
especially ex-Windows users that have been taught to hate all things 
text-based.  It will never be a 100% solution, but it can significantly 
reduce the level of attrition.


A couple of other points about the add-on, while I'm here:


I'm proposing to add HUC support to TerminalRun, which could be removed 
if/when Canonical added TerminalRun support to HUC.  Adding TerminalRun 
support to HUC would ideally involve creating a "shell script" parser, 
so people could do:

{{{#!shell
shell script
}}}

TerminalRun will add an in-page menu to any element with 
'class="shell-script"', so a shell script parser could easily hook in. 
However, given the amount of time that features take to get into HUC, 
I'd rather go with the quick route for now.

The "hint" message in the screenshot is styled to resemble the "hint" 
messages that are planned for HUC, because I like to reuse good UI 
design.  It's not identical though (e.g. using a Firefox "message" 
icon), because I prefer to reuse Firefox design elements in a Firefox 
add-on.  If anybody objects to either end of that compromise, please say.

     - Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: terminalrun-0.5.png
Type: image/png
Size: 19029 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-doc/attachments/20090722/de27ec63/attachment.png>


More information about the ubuntu-doc mailing list