function hostname=oshostname()
%OSHOSTNAME figure out hostname, irrespective of os type
%
%   usage: hostname=oshostname();
%
%

if ispc(),
	[status,hostname]=system('hostname | sed ''s/-//g''');
	if status, 
		error('oshostname error message: could not run hostname command on windows os');
	end
else
	[status,hostname]=system(['hostname -s | sed ''s/-//g''']);
	if status, 
		error('oshostname error message: could not run hostname command on *nix os');
	end

end

%remove carriage return and blank spaces
hostname=hostname(1:end-1);
hostname=ddewhite(hostname);
