我翻译的

rp请合并
This commit is contained in:
Markgolzh 2016-02-18 17:01:56 +08:00
parent 34b57351d0
commit f9dfc8e24c

View File

@ -1,15 +1,18 @@
Linux/Unix桌面趣事文本模式艺术框及注释图
Linux / Unix 桌面娱乐 :
文字模式的带有ASCII艺术的Box与评论绘制
================================================================================
Boxes command is a text filter and a little known tool that can draw any kind of ASCII art box around its input text or code for fun and profit. You can quickly create email signatures, or create regional comments in any programming language. This command was intended to be used with the vim text editor, but can be tied to any text editor which supports filters, as well as from the command line as a standalone tool.
boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者代码周围绘出任何形式的ASCII艺术框的工具。你可以快速地创建一个email签名或者在任何语言中创建一个注释。这个命令可以和vim一起使用但是可以和任何支持过滤和可以在命令行中使用独立工具的文本编辑器绑定在一起。。
Boxes 命令不仅是一个文本过滤器同时是一个很少人知道的可以为了乐趣或者需要在它的输入文本或者代码周围画各种ASCII艺术画的工具。你可以迅速创建邮件签名或者使用各种编程语言创建局部评论。这个命令计划被vim文本编辑器使用但是也可以被支持过滤的文本编辑器使用同时从命令行作为一个单独的工具使用。
### 任务: 安装 boxes ###
在Debian/Ubuntu中使用[apt-get命令][1]来安装boxes:
### 任务: 安装 boxes ###
使用 [apt-get command][1] 在 Debian / Ubuntu Linux中安装 boxes :
$ sudo apt-get install boxes
示例输出:
输出示例 :
Reading package lists... Done
Building dependency tree
@ -25,11 +28,11 @@ boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者
Processing triggers for man-db ...
Setting up boxes (1.0.1a-2.3) ...
对于RHEL / CentOS / Fedora用户使用[yum命令来安装boxes][2](首先[启用EPEL仓库][3])
RHEL / CentOS / Fedora Linux 用户, 使用 [yum command to install boxes][2] (首先 [enable EPEL repo as described here][3]):
# yum install boxes
示例输出:
输出示例 :
Loaded plugins: rhnplugin
Setting up Install Process
@ -61,52 +64,53 @@ boxes是一个文本过滤器并且是一个鲜为人知的可以在文字或者
boxes.x86_64 0:1.1-8.el6
Complete!
FreeBSD user can use the port as follows:
FreeBSD用户可以使用port
FreeBSD 用户可以按如下来使用 :
cd /usr/ports/misc/boxes/ && make install clean
或者使用pkg_add命令添加包
或者,使用 pkg_add 命令来增加包:
# pkg_add -r boxes
### 用给定的文字画出任何形式的框 ###
### 在一些给定文本周围画出任何种类的box ###
输入下面的额命令:
输入下列命令 :
echo "This is a test" | boxes
或者指定设计:
或者,通过设置要使用的设计的名字来使用 :
echo -e "\n\tVivek Gite\n\tvivek@nixcraft.com\n\twww.cyberciti.biz" | boxes -d dog
示例输出:
输出示例 :
![Unix / Linux: Boxes Command To Draw Various Designs](http://s0.cyberciti.org/uploads/l/tips/2012/06/unix-linux-boxes-draw-dog-design.png)
图01:Unix / LinuxBox命令来画出不同的设计
Fig.01: Unix / Linux: Boxes 命令来画出各式各样的设计
#### 我如何列出所有的设计? ####
#### 怎么样输出所有的设计 ####
语法是:
语法如下:
boxes option
pipe | boxes options
echo "text" | boxes -d foo
boxes -l
-d选项设置使用的设计。语法是
设计 -d 选项设置要使用的设计的名字 . 语法如下:
echo "Text" | boxes -d design
pipe | boxes -d desig
-l选项列出设计列表。它会列出配置文件中所有的设计以及它的设计者的一些信息
-l 选项列出所有设计 . 它显示在配置文件中的所有的box设计图同时也显示关于其创作者的信息。
boxes -l
boxes -l | more
boxes -l | less
示例输出:
输出示例:
43 Available Styles in "/etc/boxes/boxes-config":
-------------------------------------------------
@ -142,32 +146,32 @@ FreeBSD用户可以使用port
output truncated
..
### 我如何在vi/vim中使用boxes过滤文本 ###
### 在使用vi/vim文本编辑器时如何通过boxes过滤文本? ###
你可以在vi或者vim中使用任何外部命令。比如[插入日期和时间][4],输入:
你可以使用vi或vim支持的任何附加命令在这个例子中, [insert current date and time][4], 输入:
!!date
或者
:r !date
你需要在vim中输入上面的命令来读取date命令的输出。这可以在当前行中插入时间和日期
你需要在vim中输入以上命令来读取数据命令的输出这将在当前行后面加入日期和时分秒:
Tue Jun 12 00:05:38 IST 2012
你可以用boxes命令做同样的事情。如下创建一个示例脚本或者程序:
你可以用boxes命令做到同样的. 创建一个作为样本的shell脚本或者如下的一个c程序:
#!/bin/bash
Purpose: Backup mysql database to remote server.
Author: Vivek Gite
Last updated on: Tue Jun, 12 2012
现在输入下面的命令移动光标到第二行也就是说以Purpose开头的那行
现在输入如下 (将光标移到第二行,也就是以"Purpose: ..."开头的行)
3!!boxes
你就会得到下面的示例输出:
瞧,你就会看到如下的输出 :
#!/bin/bash
/****************************************************/
@ -175,24 +179,23 @@ FreeBSD用户可以使用port
/* Author: Vivek Gite */
/* Last updated on: Tue Jun, 12 2012 */
/****************************************************/
This video will give you an introduction to boxes command:
这个视频是boxes命令的一个介绍
这个短片将会给你介绍boxes命令:
youtube 视频
<iframe width="595" height="446" frameborder="0" src="http://www.youtube.com/embed/glzXjNvrYOc?rel=0"></iframe>
视频01boxes命令实践。顺便说一下这是我的第一个视频所以对我不要太认真并让我知道你们所想
同样可见
(Video:01: boxes command in action. BTW, this is my first video so go easy on me and let me know what you think.)
- boxes man页
另见
- boxes man 手册
--------------------------------------------------------------------------------
via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html
作者Vivek Gite
译者:[geekpi](https://github.com/geekpi)
译者:[zky001](https://github.com/zky001)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -201,5 +204,3 @@ via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text
[2]:http://www.cyberciti.biz/faq/rhel-centos-fedora-linux-yum-command-howto/
[3]:http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/
[4]:http://www.cyberciti.biz/faq/vim-inserting-current-date-time-under-linux-unix-osx/