Originally created by @moviuro on GitHub (Dec 5, 2015).
From a purely syntactic point of view, there are some things that can be enhanced:
the shebang should be #!/usr/bin/env bash so your script is portable to other UNIX systems, such as *BSD that host the bash binary at /usr/local/bin
you may be able to change all and any use of $* and replace it with $@ as the latter keeps arguments even if they contain spaces, whereas the former replaces "a b" to "a" "b"
I'll keep the script in my watch list and use it once when I'm ready to do some webadmin ;)
Originally created by @moviuro on GitHub (Dec 5, 2015).
From a purely syntactic point of view, there are some things that can be enhanced:
- the shebang should be `#!/usr/bin/env bash` so your script is portable to other UNIX systems, such as *BSD that host the `bash` binary at `/usr/local/bin`
- you may be able to change all and any use of `$*` and replace it with `$@` as the latter keeps arguments even if they contain spaces, whereas the former replaces `"a b"` to `"a" "b"`
I'll keep the script in my watch list and use it once when I'm ready to do some webadmin ;)
At the moment i think the script isn't actually very portable. E.g.: The syntax of the base64 binary differs from system to system,
I'll change the shebang after I tested that it's actually working under (some) BSD systems.
For the $*/$@ thing thanks, I'll have a look at that.
@lukas2511 commented on GitHub (Dec 5, 2015):
At the moment i think the script isn't actually very portable. E.g.: The syntax of the base64 binary differs from system to system,
I'll change the shebang after I tested that it's actually working under (some) BSD systems.
For the $*/$@ thing thanks, I'll have a look at that.
I replaced the shebang with "#!/usr/bin/env bash" and the usage of ${*} versus ${@} doesn't make any difference in the places it is used, so I'll leave it as it is now.
@lukas2511 commented on GitHub (Dec 5, 2015):
I replaced the shebang with "#!/usr/bin/env bash" and the usage of ${*} versus ${@} doesn't make any difference in the places it is used, so I'll leave it as it is now.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @moviuro on GitHub (Dec 5, 2015).
From a purely syntactic point of view, there are some things that can be enhanced:
#!/usr/bin/env bashso your script is portable to other UNIX systems, such as *BSD that host thebashbinary at/usr/local/bin$*and replace it with$@as the latter keeps arguments even if they contain spaces, whereas the former replaces"a b"to"a" "b"I'll keep the script in my watch list and use it once when I'm ready to do some webadmin ;)
@lukas2511 commented on GitHub (Dec 5, 2015):
At the moment i think the script isn't actually very portable. E.g.: The syntax of the base64 binary differs from system to system,
I'll change the shebang after I tested that it's actually working under (some) BSD systems.
For the $*/$@ thing thanks, I'll have a look at that.
@lukas2511 commented on GitHub (Dec 5, 2015):
I replaced the shebang with "#!/usr/bin/env bash" and the usage of ${*} versus ${@} doesn't make any difference in the places it is used, so I'll leave it as it is now.