[patch] bashism in sh script



Hi!

There's no thing like $[..] to evaluate expressions in POSIX sh, it's
bash feature. sh uses $((..)) instead (and bash understands it too).
Here comes fix.

-- 
Tom Pala <gotar pld-linux org>
diff -urN mc/vfs/extfs/audio.in mc.new/vfs/extfs/audio.in
--- mc/vfs/extfs/audio.in	2002-12-13 05:42:10.000000000 +0100
+++ mc.new/vfs/extfs/audio.in	2003-08-01 10:41:06.000000000 +0200
@@ -19,7 +19,7 @@
     do
     read A B C || break
     A=`echo $A | sed 's/\.//'`
-    SIZE=$[44+$B*2352]
+    SIZE=$((44+$B*2352))
     if (( $A < 10 )); then A="0$A"; fi
     echo "-r--r--r-- 1 0 0 $SIZE Jan 1 0:00 track-${A}.wav"
     done


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]