Permalink
Browse files

fix ' escape in shuffle_play

  • Loading branch information...
1 parent c4a316e commit 1a4f5df7b1a6dbf50a76de087f8990fcad887825 @quark-zju committed Apr 13, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 .profile.d/cmdrc
View
@@ -193,14 +193,12 @@ shuffle_play() {
pushd ${1:-$PWD} &>/dev/null
# use temp file, make 'q', ' ', '0' control keys available inside mplayer
local TITLE='shuffle_play'
-ruby =( cat << EOF
+ruby =(cat <<'EOF'
Dir['{,*/,*/*/,*/*/*/}*.{mp3,flac,ogg,wma}'].shuffle.each do |f|
puts f
-f.gsub! "'", "'\''"
-exit unless system("mplayer -really-quiet '#{f}'")
+exit unless system("mplayer -really-quiet '#{f.gsub "'", "'\"'\"'"}'")
end
-EOF
-)
+EOF)
popd &>/dev/null
}

0 comments on commit 1a4f5df

Please sign in to comment.