Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

for loop 'bad math expression'



Been reviewing and deleting old email backups but saving some:


for bb in *.eml~save*; do    # Error msg. points to this line.

    thunderbird -file $bb

    echo "\nFile: $bb: Press 's' to save, 'd' to delete or '^C' to quit."
    read -sk1 key

    case $key in
        d ) rm -v $bb ;;
        s ) mv -v $bb save-$bb ;;    # Rename so not viewed again.
        * ) errormsg "skipping file ..." ;;
    esac
done

... it's been working fine, done thousands.  But just now it threw me an error:

    global:20: bad math expression: operator expected at `CDF8.eml'

.... there's no such file.  They all have eight characters then '.eml':

   607 [2013-01-16--18:57] 48EE0E21.eml*
    694 [2013-01-16--18:57] 48ECE166.eml*
  10115 [2013-01-16--18:57] 48E4BB08.eml*

... like that.  And if saved:

   2842 [2013-01-16--18:57] save-48137E34.eml*
   3135 [2013-01-16--18:57] save-4812320B.eml*
   2278 [2013-01-16--18:57] save-48122AEC.eml*

Does anyone have the slightest clue what's going on here?






Messages sorted by: Reverse Date, Date, Thread, Author