https://github.com/oldratlee/shell-matrix
display matrix effect on console by shell
https://github.com/oldratlee/shell-matrix
Last synced: 24 days ago
JSON representation
display matrix effect on console by shell
- Host: GitHub
- URL: https://github.com/oldratlee/shell-matrix
- Owner: oldratlee
- Created: 2015-01-03T12:52:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-27T09:06:53.000Z (over 10 years ago)
- Last Synced: 2024-10-19T19:34:19.743Z (8 months ago)
- Language: Shell
- Size: 484 KB
- Stars: 4
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
shell matrix
=================================================:point_right: 在命令行控制台上,实现模拟生成黑客帝国中的`Matrix`字符效果。
# `Matrix`效果在命令行控制台上现在还不能显示成**3D**的 :joy:
[matrix.sh](matrix.sh)
----------------------------### 运行方式
```bash
$ ./matrix.sh
```按 ***任意键*** 退出执行。
### 意外退出的手动清理
脚本实现中,在进程退出时有清理的逻辑,应该不会有这样的情况。
#### 清理进程
如意外退出后,脚本的子进程还占用着`CPU`,可以用下面的方式手动终止启动的相关进程:
```bash
$ ps -ef | awk '/[m]atrix\.sh/{print $2}' | xargs kill -9
```#### 恢复光标
```bash
$ tput cnorm -- normal
```还需要的改进
----------------------------- 模拟效果一般,只实现了**最基本**的模拟。
- 比较耗`CPU`
显示30列的`Matrix`,在我的4核`MBP`上的`CPU`使用率达到了`50%`。
详细原因后续再分析。想法来源
----------------------------想法来自[wzt](https://github.com/cloudsec)同学,且提供了[完整可运行的脚本](cloudsec-matrix.sh)。