Just read the documentation

https://confluence.atlassian.com/display/BAMBOO032/How+can+I+pass+bamboo+variables+to+my+build+script