How to let an alias propagate to another shell script
<p>I know that it works for alias instructions in the file <em>.bashrc</em>.
However, a shell script <em>ln_hook</em>:</p>

<pre><code>#!/bin/sh
#filename: ln_hook

## http://stackoverflow.com/questions/3648819/how-to-make-symbolic-link-with-cygwin-in-windows-7
## https://cygwin.com/cygwin-ug-net/using-cygwinenv.html
## https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlinks
# export CYGWIN="winsymlinks" # ln -s: The shortcut style symlinks with file extension '.lnk'
# export CYGWIN="winsymlinks:native" # ln -s: plain text file

ln_hook(){ 
    if [[ "-s" == "$1" ]]; then
        cmd /C mklink /H "$(cygpath -aw "$3")" "`cygpath -aw "$2"`"
    else
        echo -e "\033[32m &gt;&gt; $* \033[0m"
        ln "$*"
    fi
}
alias ln='ln_hook'
type ln

(type ln)


# cannot propagate to another shell script

./test_ln

$(dirname $0)/test_ln

## . ./ln_hook
## type ln
</code></pre>

<p>and, another shell script:</p>

<pre><code>#!/bin/sh
#filename: test_ln

type ln
</code></pre>

<p>Then run <code>. ./ln_hook</code>, output: </p>

<pre><code>ln_hook
ln 是 `ln_hook' 的别名
ln 是 `ln_hook' 的别名
ln 是 /usr/bin/ln
ln 是 /usr/bin/ln
</code></pre>

<p>Is there a workaround to make the alias effective when running other scripts?</p>