instead of getopt.
local shortunits
# try things the GNU way first
- if date -d "$number $longunits" "$format" >&/dev/null ; then
+ if date -d "$number $longunits" "$format" >/dev/null 2>&1; then
date -d "$number $longunits" "$format"
else
# otherwise, convert to (a limited version of) BSD date syntax:
log verbose "done."
}
-function subkey_to_ssh_agent() {
+subkey_to_ssh_agent() {
# try to add all authentication subkeys to the agent:
local sshaddresponse
# export the key to the host keyring
gpg_authentication "--export 0x${fingerprint}!" | gpg_host --import
- if [ "$trust" == marginal ]; then
+ if [ "$trust" = marginal ]; then
trustval=1
- elif [ "$trust" == full ]; then
+ elif [ "$trust" = full ]; then
trustval=2
else
failure "Trust value requested ('$trust') was unclear (only 'marginal' or 'full' are supported)."
--- /dev/null
+It would be nice to make all of the Monkeysphere scripts POSIX
+compliant, for portability and light-weightedness. Better POSIX
+compliance would probably at least be better for compatibility with
+o{ther,lder} versions of bash. Unfortunately there are quite a few
+bashism at the moment, so this may not be trivial. For instance:
+
+ servo:~/cmrg/monkeysphere/git 0$ checkbashisms -f src/monkeysphere-server 2>&1 | wc -l
+ 50
+ servo:~/cmrg/monkeysphere/git 0$
--- /dev/null
+Since Monkeysphere is using bash, it would be nice to use the shell
+build in getopts function, instead of the external getopt program.
+This would reduce an external dependency, which would definitely be
+better for portability.