Changeset 46 in flacrip


Ignore:
Timestamp:
03/17/16 17:41:57 (9 years ago)
Author:
peter
Message:

flac2properties:

  • takes multiple files to convert
  • removes the properties file if empty (i.e., conversion was unsuccessful)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/flac2properties

    r25 r46  
    11#!/bin/bash 
    22 
    3 FLAC=$1 
    4  
    5 [ -e "$FLAC" ] || exit 
    6  
    7 PROPERTIES=$(sed -e's/\.flac$/.properties/' <<< "$FLAC") 
    8 echo $FLAC 
    9 mbz --flac "$FLAC" > "$PROPERTIES" 
     3for FLAC in "$@"; do 
     4    if [ -e "$FLAC" ]; then 
     5        PROPERTIES=$(sed -e's/\.flac$/.properties/' <<< "$FLAC") 
     6        echo $FLAC 
     7        mbz --flac "$FLAC" > "$PROPERTIES" 
     8        if [ ! -s "$PROPERTIES" ]; then 
     9            rm "$PROPERTIES" 
     10        fi 
     11    fi 
     12done 
Note: See TracChangeset for help on using the changeset viewer.