Assists music production by grouping standalone programs into sessions. Community version of "Non Session Manager".
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
403B

  1. #!/bin/sh
  2. # May 2008 Jonathan Moore Liles
  3. #
  4. # Given the name of a file containing a list of files and a filename
  5. # from that list, return the percentage of the distance from the
  6. # beginning of the list.
  7. [ $# -ne 2 ] && exit
  8. MATCH="`grep -nFx \"$2\" \"$1\"`"
  9. MATCH=${MATCH%%:*}
  10. TOTAL="`cat \"$1\" | wc -l`"
  11. if [ -z "$MATCH" ]
  12. then
  13. echo "0%"
  14. else
  15. printf "%3s%%" $(( $MATCH * 100 / $TOTAL ))
  16. fi