============================================================== GET_IP: Return current machine IP address. GENERAL ip = get_ip(void) INPUT/S -void: Unused. OUTPUT/S -year: The requested string PENDING WORK - KNOWN BUG/S -None. COMMENT/S - RELATED FUNCTION/S ABOUT -Created: February 19th, 2004 -Last update: February 19th, 2004 -Revision: 0.0.1 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function ip = get_ip(void) 0002 % ============================================================== 0003 % GET_IP: Return current machine IP address. 0004 % 0005 % 0006 % GENERAL 0007 % 0008 % ip = get_ip(void) 0009 % 0010 % INPUT/S 0011 % 0012 % -void: 0013 % Unused. 0014 % 0015 % OUTPUT/S 0016 % 0017 % -year: 0018 % The requested string 0019 % 0020 % PENDING WORK 0021 % 0022 % - 0023 % 0024 % KNOWN BUG/S 0025 % 0026 % -None. 0027 % 0028 % COMMENT/S 0029 % 0030 % - 0031 % 0032 % RELATED FUNCTION/S 0033 % 0034 % 0035 % 0036 % ABOUT 0037 % 0038 % -Created: February 19th, 2004 0039 % -Last update: February 19th, 2004 0040 % -Revision: 0.0.1 0041 % -Author: R. S. Schestowitz, University of Manchester 0042 % ============================================================== 0043 0044 % [dummy, ip] = unix('ipconfig -a | awk ''/inet/ {print $2}'' | sed ''s/^addr://g'' \ | fgrep -vx 127.0.0.1 | head -1');