terminal create file(file_name as bash arguments) then write text into it, relate to .bash_profile I am using sublime, I guess any text editors work the same.
I've just learned from this form that alias won't work and I should use function.
here is what I come up with, in .bash_profile:

function sln() {
    sublime "$1" | echo "'use strict';" &gt; "$1";
}


type sln does return the function I defined, as this: 
sln is aliased to 'sublime "" | echo "'use strict';" &gt; ""';
but when I do sln test.js, console says: No such file or directory
FYI: it works when I do sublime test.js | echo "'use strict';" &gt; test.js, and test.js will open with text 'use strict'; at the beginning. 
Can someone explain and offer some solutions? Thanks.
After modifying .bash_profile you have to either source the modified bash profile with source ~/.bash_profile or close the current and reopen a new Terminal window to have the changes take effect.
UPDATE: I had done some testing, now the solution is definitely restart Terminal.app. source ~/.bash_profile to reload is not enough.