zsh
当我bash
在 Windows 上启动时,我刚刚找到了一种启动方式
https://www.howtogeek.com/258518/how-to-use-zsh-or-another-shell-in-windows-10/。
建议在.bashrc
.
# Launch Zsh
if [ -t 1 ]; then
exec zsh
fi
Run Code Online (Sandbox Code Playgroud)
什么[ -t 1 ]
意思?
这是真的吗?
那么,我可以这样做吗?
exec zsh
Run Code Online (Sandbox Code Playgroud) 我有一个 shell 脚本执行tree
命令
$ cat _tree.sh
#!/bin/sh
tree -L 2 --charset ascii -I "_tree.sh|LICENSE|README.md|node_modules|nbproject"
$ sh _tree.sh
.
|-- bower.json
|-- dpl
|-- dst
|-- gulpfile.js
|-- package.json
`-- src
|-- fonts
|-- images
|-- scripts
`-- styles
7 directories, 3 files
$
Run Code Online (Sandbox Code Playgroud)
当我直接执行命令时,
$ tree -L 2 --charset ascii -I "_tree.sh|LICENSE|README.md|node_modules|nbproject"
.
|-- bower.json
|-- dpl/
|-- dst/
|-- gulpfile.js
|-- package.json
`-- src/
|-- fonts/
|-- images/
|-- scripts/
`-- styles/
7 directories, 3 files
$ …
Run Code Online (Sandbox Code Playgroud)