Project

General

Profile

« Previous | Next » 

Revision 8646

lib/util.run: added canon_rel_path ()

View differences:

lib/util.run
22 22

  
23 23
echo_run () { echo_cmd "$@"; "$@"; }
24 24

  
25
canon_rel_path ()
26
{
27
	local path="$1"
28
	path="$(readlink -f -- "$path")" # canonicalize
29
	path="${path#$PWD/}" # remove any shared prefix with the current dir
30
	echo "$path"
31
}
32

  
25 33
# usage: echo_func "$@"
26 34
echo_func ()
27 35
{

Also available in: Unified diff