The following script traverses your file system recursively and calls
the conversion command in every directory.
Yust point it at the root of your music library and let it do its work
(if you're on linux).

-s.

Code:
--------------------
    
  #!/bin/sh
  
  traverse()
  {
  # Traverse a directory
  cd "$1"
  pngtopnm cover.png | pnmtojpeg > cover.jpg
  ls | while read i
  do
  if [ -d "$i" ]; then
  echo "Directory: $i"
  # Calling this as a subshell means that when the called
  # function changes directory, it will not affect our
  # current working directory
  (traverse "$i" `expr $2 + 1`)
  fi
  done
  }
  
  if [ -z "$1" ]; then
  traverse . 0
  else
  traverse "$1" 0
  fi
--------------------


-- 
slimpy
------------------------------------------------------------------------
slimpy's Profile: http://forums.slimdevices.com/member.php?userid=1524
View this thread: http://forums.slimdevices.com/showthread.php?t=29105

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to