source: issm/branches/trunk-jpl-damage/src/m/utils/OS/oshostname.m@ 11577

Last change on this file since 11577 was 11577, checked in by cborstad, 13 years ago

merged changes up to r11576 from trunk-jpl into branch

File size: 551 bytes
Line 
1function hostname=oshostname()
2%OSHOSTNAME figure out hostname, irrespective of os type
3%
4% usage: hostname=oshostname();
5%
6%
7
8if ispc,
9 [status,hostname]=system('hostname | sed ''s/-//g''');hostname=hostname(1:end-1);
10
11 if status,
12 error('oshostname error message: could not run hostname command on windows os');
13 end
14
15else
16 [status,hostname]=system(['hostname -s | sed ''s/-//g''']);
17 if status,
18 error('oshostname error message: could not run hostname command on *nix os');
19 end
20 hostname=hostname(1:end-1);
21 hostname=ddewhite(hostname);
22end
Note: See TracBrowser for help on using the repository browser.