All pastes #280836 Raw Edit

Anonymous

public shellscript v1 · immutable
#280836 ·published 2006-12-16 05:32 UTC
rendered paste body
#!/bin/bashmake_chapters() {   index=0   input=()   for i   do      input[$index]="${i%.*}"      ((index++))   done   chapters=()   index=1   chapters[$index]=${input[$((index-1))]}   for ((i=1;i<${#input[@]};i++))   do      if (( ${input[$i]} > "${chapters[$index]##* }" ))      then         chapters[$index]="${chapters[$index]} ${input[$i]}"      else         ((index++))         chapters[$index]="${input[$i]}"      fi   done   printf "${chapters[1]}\n${chapters[2]}\n"}make_chapters "$@"#Example:#[%] ./script 30 33.993 76.123 0.6 43.234 87.234 130.345#30 33 76#0 43 87 130