HackerTrans
トップ新着トレンドコメント過去質問紹介求人

rrwo

no profile record

コメント

rrwo
·4 年前·議論
One thing I try to do is retrieve information from the system instead of hardcoding it.

For example, instead of

    USER=mail
    UID=8
use

    USER=mail
    UID=$(id -u $USER)
It improves portability and removes potential sources of errors.

Also note that this is something that should be done in any programming language, not just shell scripts.
rrwo
·4 年前·議論
(I missed that one, thanks)
rrwo
·4 年前·議論
I try to use the long-form of command-line switches in scripts, e.g. `cp --force` instead of `cp -f`.