title: How to mark an array in POSIX sh?
body: <p>While replacing external commands in a shell script, I used an array to get rid of awk's <code>NF</code>.</p>
  
  <p>Now, since I moved from bash to POSIX sh, I cannot get the array marked right:</p>
  
  <pre><code>#!/bin/bash
  export RANGE="0 1 4 6 8 16 24 46 53"
  RANGE=($RANGE)
  echo arrayelements: $((${#RANGE[@]}))
  LAST=$((${#RANGE[@]}-1))
  echo "Last element(replace NF): ${RANGE[$LAST]}"
  
  # ./foo
  arrayelements: 9
  Last element(replace NF): 53
  </code></pre>
  
  <p>I'm using OpenBSD's, sh and it has exactly the same size as the ksh.
  Changing above to <code>/bin/sh</code>, it seems that the following doesn't work:</p>
  
  <pre><code>set -A "$RANGE"
  set -- "$RANGE"
  </code></pre>
  
  <p>How could I realise the above script in <code>/bin/sh</code>? (Note that it works fine if you invoke bash with <code>--posix</code>, that's not what I look for.)</p>