SHARE
TWEET

Extract Voicemails

a guest Jan 28th, 2015 7,661 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. #string parsing to let me get just the file name without the entire path
  4. for filename in ~/Desktop/iOSBackup/*; do
  5.    IFS='/' read -ra ADDR <<< "$filename"
  6.    final_file=""
  7.    for i in "${ADDR[@]}"; do
  8.        final_file=$i
  9.    done
  10.    
  11. #gets all voicemail files, puts them in new folder, changes extension
  12.    if file $filename | grep GSM; then
  13.        cp $filename ~/Desktop/iOSVoicemails/$final_file.amr
  14.    fi
  15. done
RAW Paste Data
Top