Skip to main content
added 27 characters in body
Source Link
GET
  • 3
  • 1

For Ubuntu compatibility, I wrote this, which recalls the script with it's options under bash and returns the same exit code.

#!/bin/bash
if [ `readlink /proc/$$/exe` != "/bin/bash" ];then
  bash $0"$0" $@"$@"
  exit $?
fi
echo "Shell: "`readlink /proc/$$/exe`

edit: Good catch, fixed

For Ubuntu compatibility, I wrote this, which recalls the script with it's options under bash and returns the same exit code.

if [ `readlink /proc/$$/exe` != "/bin/bash" ];then
  bash $0 $@
  exit $?
fi
echo "Shell: "`readlink /proc/$$/exe`

For Ubuntu compatibility, I wrote this, which recalls the script with it's options under bash and returns the same exit code.

#!/bin/bash
if [ `readlink /proc/$$/exe` != "/bin/bash" ];then
  bash "$0" "$@"
  exit $?
fi
echo "Shell: "`readlink /proc/$$/exe`

edit: Good catch, fixed

Source Link
GET
  • 3
  • 1

For Ubuntu compatibility, I wrote this, which recalls the script with it's options under bash and returns the same exit code.

if [ `readlink /proc/$$/exe` != "/bin/bash" ];then
  bash $0 $@
  exit $?
fi
echo "Shell: "`readlink /proc/$$/exe`