Published by Niels on 29 Aug 2006
Release of NanoBlogger Gallery plugin 0.6.0
There is a new release of the NanoBlogger Gallery plugin. The previous version had a problem when run in Bash versions below 3.1. There are some differences when initializing arrays from a ’string’ using $IFS.
In Bash 3.1 you can do this:
1 2 3 4 5 6 7 8 | #!/bin/bash a="1.2.3" IFS='.' declare -a arr=( $a ) echo "${#arr[@]}" # Outputs 3 in version 3.1 and 1 in version 3.0 |
But if you instead do this then it works in both versions:
1 2 3 4 5 6 7 8 9 | #!/bin/bash a="1.2.3" IFS='.' declare -a arr eval "arr=( $a )" echo "${#arr[@]}" # Outputs 3 in version 3.1 and 3.0 |
So hopefully the Gallery plug-in is better prepared for the real world :). Thanks to Chris Gratham for helping me out with this.
The new version can be downloaded here.