Advertisement
Guest User

Extract Voicemails

a guest
Jan 28th, 2015
10,078
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None
  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
Advertisement
RAW Paste Data Copied
Advertisement