I was able to reproduce this bug. Here are the logs:
... simple 18-Mar-2013 16:13:54 Starting task 'Script' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script' command 18-Mar-2013 16:13:54 Beginning to execute external process for build 'Project-1 - Plan-2 - Default Job'\n ... running command line: \n/bin/sh /tmp/a.sh\n ... in: /Users/akhachatryan/Atlassian/BambooHome4.4.4/xml-data/build-dir/PROJ1-PLAN2-JOB1\n error 18-Mar-2013 16:13:55 /tmp/a.sh: line 1: ${bamboo.buildKey}: bad substitution simple 18-Mar-2013 16:13:55 Failing task since return code was 1 while expected 0 simple 18-Mar-2013 16:13:55 Finished task 'Script' ...
Accessing variables works for Inline script.