Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- iTunes/Music/${author}/${album}/${song.mp3}
- #!/bin/bash
- SAVEIFS=$IFS
- IFS=$(echo -en "nb")
- for f in *.mp3
- do
- lame --cbr $f __out.mp3
- mv __out.mp3 $f
- done
- IFS=$SAVEIFS
- $ cd iTunes/Music
- $ global normalize_mp3.sh
- global() {
- shopt -s globstar
- origdir="$PWD"
- for i in **/; do
- cd "$i"
- echo -n "${PWD}: "
- eval "$@"
- echo
- cd "$origdir"
- done
- }
- global normalize_mp3.sh
- $ echo $BASH_VERSION
- 4.1.5(1)-release
- $ cd /var
- $ tree -d | head
- .
- ├── backups
- ├── cache
- │ ├── apt
- │ │ ├── apt-file
- │ │ └── archives
- │ │ └── partial
- │ ├── cups
- │ │ └── rss
- │ ├── debconf
- $ global 'echo -n This command is executed in $PWD at $(date); sleep 1'
- /var/backups: This command is executed in /var/backups at Mo 1. Jul 12:11:00 CEST 2013
- /var/cache: This command is executed in /var/cache at Mo 1. Jul 12:11:01 CEST 2013
- /var/cache/apt: This command is executed in /var/cache/apt at Mo 1. Jul 12:11:02 CEST 2013
- /var/cache/apt/apt-file: This command is executed in /var/cache/apt/apt-file at Mo 1. Jul 12:11:03 CEST 2013
- /var/cache/apt/archives: This command is executed in /var/cache/apt/archives at Mo 1. Jul 12:11:04 CEST 2013
- /var/cache/apt/archives/partial: This command is executed in /var/cache/apt/archives/partial at Mo 1. Jul 12:11:05 CEST 2013
- /var/cache/cups: This command is executed in /var/cache/cups at Mo 1. Jul 12:11:07 CEST 2013
- /var/cache/cups/rss: This command is executed in /var/cache/cups/rss at Mo 1. Jul 12:11:08 CEST 2013
- /var/cache/debconf: This command is executed in /var/cache/debconf at Mo 1. Jul 12:11:09 CEST 2013
- ...
- find ~/Music -name *.mp3 | while IFS= read -r f; do
- lame --cbr "$f" "$f"_temp
- mv "$f"_temp "$f"
- done
- mdfind 'kMDItemAudioBitRate>128000' -onlyin ~/Music |
- parallel lame --cbr {} {}_temp ; mv {}_temp {}
- f() { lame --cbr "$1" "$1"_temp; mv "$1"_temp "$1"; }
- export -f f
- mdfind 'kMDItemAudioBitRate>128000' -onlyin ~/Music | parallel f
- shopt -s globstar # bash 4.0 or later
- for f in ~/Music/**/*.mp3; do lame --cbr "$f" "$f"_temp; mv "$f"_temp "$f"; done
- #!/bin/bash
- # first cd to iTunes/Music
- for f in */*/*.mp3
- do
- lame --cbr "$f" __out.mp3 && mv __out.mp3 "$f"
- done
- #! /usr/bin/env bash
- for f do
- lame --cbr "$f" "$f_out.mp3"
- mv "$f_out.mp3" "$f"
- done
- downrate_mp3 ./*.mp3
- shopt -s globstar
- downrate_mp3 ./**/*.mp3
- find iTunes/Music -type f -name '*.mp3' -exec downrate_mp3 {} +
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement