function out = rel_path(in,root,name)

% rel_path - display relative path using token
% --------------------------------------------
%
% out = rel_path(in,root,name)
%
% Input:
% ------
%  in - absolute path
%  root - root path
%  name - root token name
%
% Output:
% -------
%  out - relative path

%--------------------------------
% Author: Harold Figueroa
%--------------------------------
% $Revision: 1600 $
% $Date: 2005-08-18 17:41:06 -0400 (Thu, 18 Aug 2005) $
%--------------------------------

%--
% handle input
%--

if (nargin < 3)
	name = '$XBAT_ROOT';
end

if (nargin < 2)
	root = xbat_root;
end

%--
% perform replacement, possibly display
%--

out = strrep(in,root,name);

if (~nargout)
	disp(out);
end