Changeset 16957


Ignore:
Timestamp:
11/26/13 15:18:00 (11 years ago)
Author:
Mathieu Morlighem
Message:

BUG: safer oshostname, needed to add < /dev/null to avoid wrong name

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/os/oshostname.m

    r15121 r16957  
    77
    88if ispc(),
    9         [status,hostname]=system('hostname');
     9        [status,hostname]=system('hostname < /dev/null');
    1010        if status,
    1111                error('oshostname error message: could not run hostname command on windows os');
    1212        end
    1313else
    14         [status,hostname]=system(['hostname -s | sed ''s/-//g''']);
     14        %See http://www.mathworks.com/help/matlab/ref/system.html "tips" section
     15        %We need to add < /dev/null otherwise what is in the clipboard is added
     16        [status,hostname]=system('hostname < /dev/null');
     17        hostname = strrep(hostname,'-','')
    1518        if status,
    1619                error('oshostname error message: could not run hostname command on *nix os');
    1720        end
    18 
    1921end
    2022
Note: See TracChangeset for help on using the changeset viewer.