Alias not recognized within script

What would cause a script to work under one user account and not another? Here's an example of what I'm referring to.

Here's a simple script. Let's put it in a file called �thescript�.

#! /bin/bash
alias a='echo hello world'
a

Here are the results when this script is executed logged in under one user account.

$ thescript
hello world

Here are the results when this script is executed logged in from a different user account.

$ thescript
command 'a' not found

The second account doesn't seem to recognize the defined alias within the script. And I say within the script because I can manually define an alias from the command line, and it works just fine. Both accounts are on the exact same system. Each account has its own version of the script which is owned by the account. If it matters, this system is running Redhat linux 6.2. Any ideas???

root@bt> cat run
#!/bin/bash
shopt -s expand_aliases
alias a='echo hello world'
a

man aliases

man shopt

Why it was working for the other account, may be expand_aliases was set in his profile or somewhere or may be some other reason. Just my guess!

--ahamed

Thank you. You're exactly right! I've since done some additional research myself under the bash man page and rediscovered what I remember reading from about 2 years ago. I had simply forget about that option. BTW, the initial account where the script was working was my own personal account, and yes, in my login files I had already set that particular shopt option. In the account I was trying to get the script to work, that particular option had not been set.

Also note from the bash man page:

For almost every purpose, aliases are superseded by shell functions.