Shell Script Development

主要面向 Bash。

⬅︎ 返回上层

TOC

其他

测试

颜色

参数解析

  • dispatch: A full command line argument dispatcher in 50 lines of portable shell script. Unlike many argument parsers, dispatch is not designed to be used inside case/esac control structures. It behaves like a router for shell script functions.

工具集

  • composure: 超好用的工具链
  • shellfire: 提供很多便利的函数,用于 shell 脚本开发
  • https://github.com/alexanderepstein/Bash-Snippets
  • lobash: bash 专用的工具函数集合。类似 JS 的 Lodash。
  • readlinkf: 跨平台、POSIX 兼容的 readlink -f

LSP

Lint

格式化 Formater

自动补全

https://github.com/scop/bash-completion

可通过 brew 安装,brew install bash-completion for bash 3.x,brew install bash-completion@2 for bash 4.x。

日志

文件定位

  • lookup.sh: Look up project directory based on a locator file. Never write ../../ relative path format.