On Thu, 2014-07-03 at 10:24 +0530, Amit Kucheria wrote:
On Thu, Jul 3, 2014 at 7:37 AM, Lisa Nguyen lisa.nguyen@linaro.org wrote:
[...]
diff --git a/include/functions.sh b/include/functions.sh index 6d75e34..d44706f 100644 --- a/include/functions.sh +++ b/include/functions.sh @@ -285,10 +285,10 @@ check_cpuhotplug_files() { shift 1
for i in $@; do
# skip check for cpu0
if [ `echo $dirpath | grep -c "cpu0"` -eq 1 ]; then
continue
fi
if [[ $dirpath =~ cpu0$ && $hotplug_allow_cpu0 -eq 0 ]]; then
I just checked 'man bash' for the meaning of =~ and found this:
"The return value is 0 if the string matches the pattern, and 1 otherwise."
So if you find cpu0 in $dirpath, it'll return a zero, right? So your above expression becomes zero and you don't end up skipping the test for cpu0.
But in shells, isn't zero true and non-zero false, and && behaves accordingly?
I have another comment though, will the scripts only be used on systems with bash? If we can't guarantee this perhaps bash specific features should be avoided. (Is the android shell bash compatible?)