Rules (I continuously will update it):
- Do not use pushd/popd! Use 'cd -'.
- Do not use double equal to compare. This is not c++. Use just one ('=').
- Do not use double bracket [[ $foo ]]. Use single bracket ('[ $foo ]').
$export foo=cica
$echo "$foo"
cica
$echo "$foo"
$foo
There is substitution at first case while the other one there wasn't.
Shell script usually started with shebang (or hashbang):
#!/bin/sh
Debug features in shell:
set -euxv
e : stop first error
u : check uninitialized variables / prevent undefined behavior
x : print line the executed command
v : print line as read from input
In posix the return values always a positive numbers (0-255).
No comments:
Post a Comment