Project

General

Profile

« Previous | Next » 

Revision 11431

bugfix: lib/sh/util.sh: $top_script: use @BASH_SOURCE instead of $0, because this is also defined for .-scripts

View differences:

lib/sh/util.sh
715 715

  
716 716
#### paths
717 717

  
718
top_symlink_dir="$(dirname "$0")"; echo_vars top_symlink_dir
718
top_script="${BASH_SOURCE[${#BASH_SOURCE[@]}-1]}"
719
	# outermost script; unlike $0, also defined for .-scripts
720

  
721
top_symlink_dir="$(dirname "$top_script")"; echo_vars top_symlink_dir
719 722
top_symlink_dir_abs="$(realpath "$top_symlink_dir")"
720 723
	echo_vars top_symlink_dir_abs
721 724

  
722
top_script_abs="$(realpath "$0")"; echo_vars top_script_abs # outermost script
725
top_script_abs="$(realpath "$top_script")"; echo_vars top_script_abs
723 726
	# realpath this before doing any cd so this points to the right place
724 727
top_dir_abs="$(dirname "$top_script_abs")"; echo_vars top_dir_abs
725 728

  

Also available in: Unified diff