You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the script doesn't keep a single style, has a lot of redundancy, etc.
E.g.,
if [ ! -d "$FOO" ]; then
mkdir -p "$FOO"
fi
First of all this can be written as
[ -d "$FOO" ] || mkdir -p "$FOO"
but hey, the -p is exactly to avoid this all, and hence
mkdir -p "$FOO"
is enough.
Next one, cat ... | grep. Google for "useless use of cat", it is a very old idiom in UNIX to avoid unnecessary forks of processes that are not needed at all.
Last, but not least, change shebang to #!/bin/sh -efu and fix all issues with the script. It will get more portability and robustness.
The text was updated successfully, but these errors were encountered:
It seems like the script doesn't keep a single style, has a lot of redundancy, etc.
E.g.,
First of all this can be written as
but hey, the
-p
is exactly to avoid this all, and henceis enough.
Next one,
cat ... | grep
. Google for "useless use of cat", it is a very old idiom in UNIX to avoid unnecessary forks of processes that are not needed at all.Last, but not least, change shebang to
#!/bin/sh -efu
and fix all issues with the script. It will get more portability and robustness.The text was updated successfully, but these errors were encountered: