I would like a solution that works for bash on darwin (OS X).
if [ $(uname) == "Darwin" ]; then
EUCA_KEY_DIR=$(dirname $(stat -f ${BASH_SOURCE}))
else
EUCA_KEY_DIR=$(dirname $(readlink -f ${BASH_SOURCE}))
fi
On Sun, Dec 18, 2011 at 6:49 PM, Garrett Holmstrom <
<email address hidden>> wrote:
> Lovely. $_ changes based on the environment. At least
> ${BASH_SOURCE:-$0} will make it work for bash and zsh. It doesn't fix
> it for dash or ksh, but it is still an improvement over what we have
> now.
>
> It looks like that's what the Nova people are doing, too:
> https://bugs.launchpad.net/nova/+bug/787351
>
> --
> You received this bug notification because you are a member of
> Eucalyptus Maintainers, which is subscribed to Eucalyptus.
> https://bugs.launchpad.net/bugs/376425
>
> Title:
> generated eucarc contains bashisms
>
> Status in Eucalyptus:
> Confirmed
> Status in Eucalyptus 2.0 series:
> Confirmed
>
> Bug description:
> The first line in the generated eucarc (when downloading x509
> certificate) is:
> EUCA_KEY_DIR=$(dirname $(readlink -f ${BASH_SOURCE}))
> Which doesn’t work in zsh at all.
> I suggest replacing it by something like this:
> EUCA_KEY_DIR="$(cd "${0%/*}" && pwd -P)"
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/eucalyptus/+bug/376425/+subscriptions
>
I would like a solution that works for bash on darwin (OS X).
if [ $(uname) == "Darwin" ]; then DIR=$(dirname $(stat -f ${BASH_SOURCE})) DIR=$(dirname $(readlink -f ${BASH_SOURCE}))
EUCA_KEY_
else
EUCA_KEY_
fi
On Sun, Dec 18, 2011 at 6:49 PM, Garrett Holmstrom <
<email address hidden>> wrote:
> Lovely. $_ changes based on the environment. At least /bugs.launchpad .net/nova/ +bug/787351 /bugs.launchpad .net/bugs/ 376425 DIR=$(dirname $(readlink -f ${BASH_SOURCE})) /bugs.launchpad .net/eucalyptus /+bug/376425/ +subscriptions
> ${BASH_SOURCE:-$0} will make it work for bash and zsh. It doesn't fix
> it for dash or ksh, but it is still an improvement over what we have
> now.
>
> It looks like that's what the Nova people are doing, too:
> https:/
>
> --
> You received this bug notification because you are a member of
> Eucalyptus Maintainers, which is subscribed to Eucalyptus.
> https:/
>
> Title:
> generated eucarc contains bashisms
>
> Status in Eucalyptus:
> Confirmed
> Status in Eucalyptus 2.0 series:
> Confirmed
>
> Bug description:
> The first line in the generated eucarc (when downloading x509
> certificate) is:
> EUCA_KEY_
> Which doesn’t work in zsh at all.
> I suggest replacing it by something like this:
> EUCA_KEY_DIR="$(cd "${0%/*}" && pwd -P)"
>
> To manage notifications about this bug go to:
> https:/
>
--
*______ _______ _______ _____*
*David Kavanagh - *Software Engineer
*Eucalyptus Systems*
www.eucalyptus.com
*______ _______ _______ _____*