MusicFinder

From KCLUG Wiki

Jump to: navigation, search

From Bash and Command line One-Liners

 
 #!/bin/bash

  GREPS=""

  for next in $@ ;
  do
      if [ -z "$GREPS" ] ; then
         GREPS='/'$next'/'
      else
         GREPS=`echo $GREPS \&\& /$next/`
      fi
  done 

  GREPS=`echo 'BEGIN {IGNORECASE = 1}' ${GREPS} '&& $0 !~ /^$/ {print $0;}'` 

  find /home/my/music | gawk "$GREPS"
Personal tools