Mercurial > repos > vipints > rdiff
view rDiff/tools/whoami.m @ 3:29a698dc5c7e default tip
Merge multiple heads.
author | Dave Bouvier <dave@bx.psu.edu> |
---|---|
date | Mon, 27 Jan 2014 14:15:36 -0500 |
parents | 0f80a5141704 |
children |
line wrap: on
line source
function user_name = whoami % WHOAMI Determines user name. % % user_name = whoami % % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 3 of the License, or % (at your option) any later version. % % Written (W) 2009-2010 Gunnar Raetsch % Copyright (C) 2009-2010 Max Planck Society % global whoami_user_name if isempty(whoami_user_name) [ret, whoami_user_name]=unix('whoami') ; if ret~=0, if keyboard_allowed(), keyboard ; end ; whoami_user_name='unknown' ; end ; end ; user_name= whoami_user_name ; idx=find(user_name<30, 1, 'first') ; user_name = user_name(1:idx-1) ;