mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
bash syntax #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.