Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CentOS Docs (http://www.linux-archive.org/centos-docs/)
-   -   Format for giving examples of commands (http://www.linux-archive.org/centos-docs/673824-format-giving-examples-commands.html)

Akemi Yagi 06-17-2012 08:03 PM

Format for giving examples of commands
 
On Sun, Jun 17, 2012 at 11:37 AM, Yves Bellefeuille <yan@storm.ca> wrote:
> Hello,
>
> Is there a standard format for quoting examples of commands to be
> entered by the user?
>
> I've given the following example commands:
>
> cd /tmp
> wget http://www.skype.com/go/getskype-linux-beta-static
> cd /opt
> tar xjvf /tmp/skype_static-4.0.0.7.tar.bz2
> rm /tmp/skype_static-4.0.0.7.tar.bz2
> ln -s skype_staticQT-4.0.0.7 skype
>
> Someone changed them to add prompts:
>
> [root@host]# cd /tmp
> [root@host]# wget http://www.skype.com/go/getskype-linux-beta-static
> [root@host]# cd /opt
> [root@host]# tar xjvf /tmp/skype_static-4.0.0.7.tar.bz2
> [root@host]# rm /tmp/skype_static-4.0.0.7.tar.bz2
> [root@host]# ln -s skype_staticQT-4.0.0.7 skype
>
> I think my way is better, since the user can simply copy and paste the
> entire example into a terminal. Conversely, with a prompt, there's no
> chance that the example will be confused with a program listing, but I
> don't think that's likely to happen.
>
> Is either format preferred?

I think people's opinions will split on this. When the above change
was made, Karanbir Singh noted on IRC:

< kbsingh> yeah, that also makes sure that people cant copy + paste
stuff in one go
< kbsingh> they need to copy bits in one piece at a time

I tend to agree that we want to be sure users do not just copy the
while thing in one shot.

Another (actually main) purpose of presenting the prompt is to
distinguish the commands that must (or must not) be run as root.

Akemi
_______________________________________________
CentOS-docs mailing list
CentOS-docs@centos.org
http://lists.centos.org/mailman/listinfo/centos-docs

Yves Bellefeuille 06-17-2012 08:23 PM

Format for giving examples of commands
 
On Sunday 17 June 2012, Akemi Yagi <amyagi@gmail.com> wrote:

> I think people's opinions will split on this. When the above change
> was made, Karanbir Singh noted on IRC:

I guess I'll have to start following IRC.

> I tend to agree that we want to be sure users do not just copy the
> while thing in one shot.

The main problem with copy and paste, I think, is that usually a
carriage return is automatically added at the end, and so the command is
immediately executed. Forcing users to copy and paste individual bits
does nothing to prevent this.

Yves

--
Yves Bellefeuille <yan@storm.ca>
"La Esperanta Civito ne rifuzas anticipe la kunlaboron de erarintoj, se
ili konscias pri sia eraro." -- Heroldo Komunikas, n-ro 473.
_______________________________________________
CentOS-docs mailing list
CentOS-docs@centos.org
http://lists.centos.org/mailman/listinfo/centos-docs

Ralph Angenendt 06-17-2012 09:42 PM

Format for giving examples of commands
 
On 17.06.2012 22:23, Yves Bellefeuille wrote:

> The main problem with copy and paste, I think, is that usually a
> carriage return is automatically added at the end, and so the command is
> immediately executed. Forcing users to copy and paste individual bits
> does nothing to prevent this.

Yes, but you cannot copy&paste in one go, thus maybe destroying *all*
data on your machine (but only a bit of it) :)

For my lazyness c&p in one go would be better, but for getting me to
think about something, this is better.

Regards,

Ralph

_______________________________________________
CentOS-docs mailing list
CentOS-docs@centos.org
http://lists.centos.org/mailman/listinfo/centos-docs


All times are GMT. The time now is 10:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.