Find all files in the /dev directory with permissions of 004 and a filename ending in ".sh", and execute the command "sed -i "s/[^GA]/B/g" {}" on each of them.
find /dev -perm /004 -name "*.sh" -exec sed -i "s/[^GA]/B/g" {} \;