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