Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Filename restrictions' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Filename restrictions
Authored by: palpitate on Sep 07, '06 07:51:08AM
The script is not carefull enough with quoting variables. Try:
#!/bin/bash

mdirname='cur'

find . -name $mdirname | while read from; do
 nm=`dirname "$from" | sed 's/[^a-zA-Z0-9]/-/g; s/^-*//; s/--*/-/' `
 echo "Converting $from into $nm"

 /bin/ls -1 "$from" | while read message; do 
  echo -n `cat "$from/$message" | grep '^From:' | head -n1 | sed 's/.*]*)>.*/From 1/'`
  date '+%a %b %e %H:%M:%S %Y'
  cat "$from/$message" | sed 's/^From /From:/'
 done > $nm.mbox
done


[ Reply to This | # ]