[snip]
That tells me nothing that I can't see from your previous snippet.
So, let's recap.
You have a script or scripts, buried somewhere within the sum total
of scripts that ssh executes on your behalf when you log in to a
remote system, that generate specific error messages. You wish to
debug and rectify these error messages. The error messages are:
dirname: invalid option -- 'b'
Try 'dirname --help' for more information.
readlink: invalid option -- 'b'
Try 'readlink --help' for more information.
First off, the error messages are mostly self-explanatory. Somewhere
in your scripts, you invoke dirname(1) with the "-b" option, and
elsewhere, you invoke readlink(1), again with the "-b" option. Neither
dirname(1) nor readlink(1) /have/ a "-b" option, and tell you so.
So, you have to determine
1) where the offending dirname(1) is,
2) how that dirname(1) gets an errant "-b" option,
3) where the offending readlink(1) is, and
4) how that readlink(1) gets an errant "-b" option
Then, you have to change things so that neither the
dirname(1) nor the readlink(1) get the bad "-b" option.
By implication, you have isolated the offending dirname(1) and
readlink(1) invocations to a specific code snippet, which you
posted here. These invocations depend on the /specific values/
of two parameters: $1 and ${BASH_SOURCE[0]}. The values of these
two parameters, on login via ssh, will tell you if you have
located the offending code snippet. At least one of these values
will contain a "-b", the offending option passed to dirname(1)
and readlink(1).
Find that, and fix it.
HTH
--30--