variables in find command and more shell problem

view story

http://unix.stackexchange.com – I wrote the following script: #!/bin/bash SAVEIFS=$IFS alias export='export' IFS=$(echo -en "\n\b") find $1 -name "*" -a -type f -exec sh -c let len=`expr length {}` \; -exec sh -c let str=`expr substr {} 1 len-3` \; -exec ffmpeg -y -i {} $str.mp3 \; # restore $IFS unalias export IFS=$SAVEIFS Problem: You know when more one shell you can't export your variable in other shell, So i need to : use variables don't use run shell So, how i do it? When run the following script: find $1 -name "*" -a -type f -exec let len=`expr length {}` \; -exec let str=`expr substr {} (HowTos)