I'm having some difficulty understanding a subtlety of how a bash script works with arguments when it's accessed via a symbolic link. The issue is most easily explained with commands and their output:
$ type ll
ll is aliased to `ls -Alt --color=auto'
$ cat myshellscript
#!/bin/bash
type $1
$ ls -l myshellscript
-rwxr-xr-x 1 pi pi 20 Aug 22 19:55 myshellscript
$ . myshellscript ll
ll is aliased to `ls -Alt --color=auto'
$ ls -l /usr/local/bin
total 0
lrwxrwxrwx 1 root root 21 Aug 22 19:56 mss -> /home/pi/sh/myshellscript
$ mss ls
ls is /bin/ls
$ echo "OK, that worked"
OK, that worked
$ mss ll
/usr/local/bin/st: line 2: type: ll: not found
$ echo "Why didn't that work?"
Why didn't that work?
. myshellscript ll
you are sourcing the script whereas inmss ll
you are just running it. See also Can't use alias in script, even if I define it just above! – steeldriver Aug 24 '19 at 00:14. mss ll
it will work, for the reasons pointed out by steeldriver – George Vasiliou Aug 24 '19 at 00:22