translated

This commit is contained in:
geekpi 2019-09-26 08:54:03 +08:00
parent 9b2cde419f
commit d98af2b986
2 changed files with 106 additions and 106 deletions

View File

@ -1,106 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A Quick Look at Elvish Shell)
[#]: via: (https://itsfoss.com/elvish-shell/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
A Quick Look at Elvish Shell
======
Everyone who comes to this site has some knowledge (no matter how slight) of the Bash shell that comes default of so many systems. There have been several attempts to create shells that solve some of the shortcomings of Bash that have appeared over the years. One such shell is Elvish, which we will look at today.
### What is Elvish Shell?
![Pipelines In Elvish][1]
[Elvish][2] is more than just a shell. It is [also][3] “an expressive programming language”. It has a number of interesting features including:
* Written in Go
* Built-in file manager, inspired by the [Ranger file manager][4] (`Ctrl + N`)
* Searchable command history (`Ctrl + R`)
* History of directories visited (`Ctrl + L`)
* Powerful pipelines that support structured data, such as lists, maps, and functions
* Includes a “standard set of control structures: conditional control with `if`, loops with `for` and `while`, and exception handling with `try`
* Support for [third-party modules via a package manager to extend Elvish][5]
* Licensed under the BSD 2-Clause license
“Why is it named Elvish?” I hear you shout. Well, according to [their website][6], they chose their current name because:
> In roguelikes, items made by the elves have a reputation of high quality. These are usually called elven items, but “elvish” was chosen because it ends with “sh”, a long tradition of Unix shells. It also rhymes with fish, one of the shells that influenced the philosophy of Elvish.
### How to Install Elvish Shell
Elvish is available in several mainstream distributions.
Note that the software is very young. The most recent version is 0.12. According to the projects [GitHub page][3]: “Despite its pre-1.0 status, it is already suitable for most daily interactive use.”
![Elvish Control Structures][7]
#### Debian and Ubuntu
Elvish packages were introduced into Debian Buster and Ubuntu 17.10. Unfortunately, those packages are out of date and you will need to use a [PPA][8] to install the latest version. You will need to use the following commands:
```
sudo add-apt-repository ppa:zhsj/elvish
sudo apt update
sudo apt install elvish
```
#### Fedora
Elvish is not available in the main Fedora repos. You will need to add the [FZUG Repository][9] to install Evlish. To do so, you will need to use these commands:
```
sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repol
sudo dnf install elvish
```
#### Arch
Elvish is available in the [Arch User Repository][10].
I believe you know [how to change shell in Linux][11] so after installing you can switch to Elvish to use it.
### Final Thoughts on Elvish Shell
Personally, I have no reason to install Elvish on any of my systems. I can get most of its features by installing a couple of small command line programs or using already installed programs.
For example, the search past commands feature already exists in Bash and it works pretty well. If you want to improve your ability to search past commands, I would recommend installing [fzf][12] instead. Fzf uses fuzzy search, so you dont need to remember the exact command you are looking for. Fzf also allows you to preview and open files.
I do think that the fact that Elvish is also a programming language is neat, but Ill stick with Bash shell scripting until Elvish matures a little more.
Have you every used Elvish? Do you think it would be worthwhile to install Elvish? What is your favorite Bash replacement? Please let us know in the comments below.
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][13].
--------------------------------------------------------------------------------
via: https://itsfoss.com/elvish-shell/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/pipelines-in-elvish.png?fit=800%2C421&ssl=1
[2]: https://elv.sh/
[3]: https://github.com/elves/elvish
[4]: https://ranger.github.io/
[5]: https://github.com/elves/awesome-elvish
[6]: https://elv.sh/ref/name.html
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Elvish-control-structures.png?fit=800%2C425&ssl=1
[8]: https://launchpad.net/%7Ezhsj/+archive/ubuntu/elvish
[9]: https://github.com/FZUG/repo/wiki/Add-FZUG-Repository
[10]: https://aur.archlinux.org/packages/elvish/
[11]: https://linuxhandbook.com/change-shell-linux/
[12]: https://github.com/junegunn/fzf
[13]: http://reddit.com/r/linuxusersgroup

View File

@ -0,0 +1,106 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A Quick Look at Elvish Shell)
[#]: via: (https://itsfoss.com/elvish-shell/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
快速了解 Elvish Shell
======
每个来到这里的人都会对许多系统默认 Bash shell 有所了解(无论多少)。过去这些年已经有一些新的 shell 出现来解决 Bash 中的一些缺点。Elvish 就是其中之一,我们将在今天讨论它。
### 什么是 Elvish Shell
![Pipelines In Elvish][1]
[Elvish][2] 不只是一个 shell。它[也是][3]“一种表达性编程语言”。它有许多有趣的特性,包括:
* 使用 Go 语言编写
* 内置文件管理器,灵感来自 [Ranger 文件管理器][4]`Ctrl + N`
* 可搜索的命令历史记录(`Ctrl + R`
* 历史访问目录(`Ctrl + L`
* 支持结构化数据,例如列表、字典和函数的强大的管道
* 包含“一组标准的控制结构:有 `if` 条件控制、 `for``while` 循环,还有 `try` 的异常处理”
* 通过包管理器支持[第三方模块扩展 Elvish][5]
* BSD 2-Clause 许可
我听到了你的大叫,“为什么叫 Elvish”。好吧根据[他们的网站][6],他们之所以选择当前的名字,是因为:
> 在 Roguelike 中,精灵制造的物品质量很高。它们通常被称为“精灵物品”。但是之所以选择 “elvish” 是因为它以 “sh” 结尾,这是 Unix shell 的久远传统。这个与 fish 押韵,它是影响 Elvish 哲学的 shell 之一。
### 如何安装 Elvish Shell
Elvish 在几种主流发行版中都有。
请注意,该软件还很年轻。最新版本是 0.12。根据该项目的 [GitHub 页面][3]:“尽管还在 1.0 之前,但它已经适合大多数日常交互使用。”
![Elvish Control Structures][7]
#### Debian 和 Ubuntu
Elvish 包已引入 Debian Buster 和 Ubuntu 17.10。不幸的是,这些包已经过时,你将需要使用 [PPA][8] 安装最新版本。你需要使用以下命令:
```
sudo add-apt-repository ppa:zhsj/elvish
sudo apt update
sudo apt install elvish
```
#### Fedora
Elvish 在 Fedora 的主仓库中没有。你需要添加 [FZUG 仓库][9]安装 Evlish。为此你需要使用以下命令
```
sudo dnf config-manager --add-repo=http://repo.fdzh.org/FZUG/FZUG.repol
sudo dnf install elvish
```
#### Arch
Elvish 在 [Arch 用户仓库][10]中可用。
我相信你知道该[如何在 Linux 中更改 Shell][11],因此安装后可以切换到 Elvish 来使用它。
### 对 Elvish Shell 的想法
就个人而言,我没有理由在任何系统上安装 Elvish。我可以通过安装几个小的命令行程序或使用已经安装的程序来获得它的大多数功能。
例如Bash 中已经存在“搜索历史命令”功能,并且效果很好。如果要提高历史命令的能力,我建议安装 [fzf][12]。fzf 使用模糊搜索因此你无需记住要查找的确切命令。fzf 还允许你预览和打开文件。
我认为 Elvish 作为一种编程语言是不错的,但是我会坚持使用 Bash shell 脚本,直到 Elvish 变得更成熟。
你们都有用过 Elvish 么?你认为安装 Elvish 是否值得?你最喜欢的 Bash 替代品是什么?请在下面的评论中告诉我们。
如果你发现这篇文章有趣请花一点时间在社交媒体、Hacker News 或 [Reddit][13] 上分享它。
--------------------------------------------------------------------------------
via: https://itsfoss.com/elvish-shell/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/05/pipelines-in-elvish.png?fit=800%2C421&ssl=1
[2]: https://elv.sh/
[3]: https://github.com/elves/elvish
[4]: https://ranger.github.io/
[5]: https://github.com/elves/awesome-elvish
[6]: https://elv.sh/ref/name.html
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/05/Elvish-control-structures.png?fit=800%2C425&ssl=1
[8]: https://launchpad.net/%7Ezhsj/+archive/ubuntu/elvish
[9]: https://github.com/FZUG/repo/wiki/Add-FZUG-Repository
[10]: https://aur.archlinux.org/packages/elvish/
[11]: https://linuxhandbook.com/change-shell-linux/
[12]: https://github.com/junegunn/fzf
[13]: http://reddit.com/r/linuxusersgroup