Skip to content
プロジェクト

SixArm/unix-shell-script-tactics

GitHubで見る

概要

Unix shell script tactics - best practices style guide

学習・教育

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
-1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Unix shell script tactics - best practices style guide

This Unix shell script style guide helps us write better Unix shell script code for speed, security, stability, and portability.

This guide is by SixArm.com, a software consultancy. Our customers use shell scripts within a wide variety of Unix shells, so we aim for POSIX for simple scripts.

Highlights:

Recommendations (details of these are TODO):

  • Quote liberally such as "$var" instead of just $var, for safety.
  • Bulletproof scripts to handle characters such as a quote, newline, leading dash.
  • Enable a user to customize commands by using env vars such as ${FOO:-foo}.
  • Create temporary files by using mktemp instead of tempfile et. al.

Demo:

Topics

Argument parsing:

Environment variables:

Directories:

Files:

References:

Conventions:

Control flow statements:

Functions:

Command snippets:

Compatibilities:

PostgreSQL psql:

関連プロジェクトを探す

読み込み中…