Index: /issm/trunk/src/m/utils/OS/issmssh.m
===================================================================
--- /issm/trunk/src/m/utils/OS/issmssh.m	(revision 1582)
+++ /issm/trunk/src/m/utils/OS/issmssh.m	(revision 1582)
@@ -0,0 +1,42 @@
+function issmssh(host,command)
+%ISSMSSH wrapper for OS independent ssh command.
+%
+%   usage: issmssh(host,command)
+%
+%
+
+%first get hostname 
+hostname=oshostname();
+
+
+%if same as host, just run the command. 
+if strcmpi(host,hostname),
+	system(command);
+else
+	if ispc,
+		%use the putty project plink.exe: it should be in the path.
+		
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+		if status, 
+			error('issmssh error message: could not find ISSM_DIR_WIN envirnoment variable');
+		end
+		ISSM_DIR=ISSM_DIR(2:end-2);
+
+		username=input('Username: (quoted string) ');
+		password=input('Password: (quoted string) ');
+
+		[status,result]=system([ISSM_DIR '/externalpackages/ssh/plink.exe -ssh -l "' username '" -pw "' password '" ' host ' "' command '"']);
+
+		if status, 
+			error('issmssh error message: could not call putty plink');
+		end
+
+	else
+		%just use standard unix ssh
+		[status,result]=system(['ssh ' host ' ' command]);
+		if status, 
+			error('issmssh error message: could not call ssh on *nix system');
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/OS/oshostname.m
===================================================================
--- /issm/trunk/src/m/utils/OS/oshostname.m	(revision 1582)
+++ /issm/trunk/src/m/utils/OS/oshostname.m	(revision 1582)
@@ -0,0 +1,21 @@
+function hostname=oshostname()
+%OSHOSTNAME figure out hostname, irrespective of os type
+%
+%   usage: hostname=oshostname();
+%
+%
+
+if ispc,
+	[status,hostname]=system('hostname');hostname=hostname(1:end-1);
+
+	if status, 
+		error('oshostname error message: could not run hostname command on windows os');
+	end
+
+else
+	[status,hostname]=system('hostname -s');
+	if status, 
+		error('oshostname error message: could not run hostname command on *nix os');
+	end
+	hostname=hostname(1:end-1);
+end
Index: /issm/trunk/src/m/utils/OS/scpin.m
===================================================================
--- /issm/trunk/src/m/utils/OS/scpin.m	(revision 1582)
+++ /issm/trunk/src/m/utils/OS/scpin.m	(revision 1582)
@@ -0,0 +1,54 @@
+function scpin(host, path, packages)
+%SCPIN get packages from host, using scp on unix, and pscp on windows
+%
+%   usage: scpin(host,packages,path)
+%
+%
+
+%first get hostname
+hostname=oshostname();
+
+%if hostname and host are the same, do a simple copy
+if strcmpi(hostname,host),
+
+    for i=1:numel(packages),
+		copyfile(packages{i});
+	end
+
+else
+
+	if ispc,
+		%use the putty project pscp.exe: it should be in the path.
+		
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+		if status, 
+			error('scpin error message: could not find ISSM_DIR_WIN envirnoment variable');
+		end
+		ISSM_DIR=ISSM_DIR(2:end-2);
+
+		username=input('Username: (quoted string) ');
+		password=input('Password: (quoted string) ');
+
+		for i=1:numel(packages),
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' host ':' path '/' packages{i} ' ./']);
+			if status, 
+				error('scpin error message: could not call putty pscp');
+			end
+		end
+
+	else
+		%just use standard unix scp
+		%string to copy multiple files using scp: 
+		string='\{';
+		for i=1:numel(packages)-1,
+			string=[string packages{i} ','];
+		end
+		string=[string packages{end} '\}'];
+
+		[status,result]=system(['scp ' host ':' path '/' sring ' ./']);
+		if status, 
+			error('scpin error message: could not call scp on *nix system');
+		end
+	end
+end
Index: /issm/trunk/src/m/utils/OS/scpout.m
===================================================================
--- /issm/trunk/src/m/utils/OS/scpout.m	(revision 1582)
+++ /issm/trunk/src/m/utils/OS/scpout.m	(revision 1582)
@@ -0,0 +1,52 @@
+function scpout(host,path,packages)
+%SCPOUT send packages to a host, using scp on unix, and pscp on windows
+%
+%   usage: scpout(host,path,packages)
+%
+%
+
+%get hostname
+hostname=oshostname();
+
+%if hostname and host are the same, do a simple copy
+
+if strcmpi(host,hostname),
+	for i=1:numel(packages),
+		copyfile(packages{i},path);
+	end
+else 
+	if ispc,
+		%use the putty project pscp.exe: it should be in the path.
+		
+		%get ISSM_DIR variable
+		[status,ISSM_DIR]=system('echo [%ISSM_DIR_WIN%]');
+		if status, 
+			error('scpout error message: could not find ISSM_DIR_WIN envirnoment variable');
+		end
+		ISSM_DIR=ISSM_DIR(2:end-2);
+
+		username=input('Username: (quoted string) ');
+		password=input('Password: (quoted string) ');
+
+		for i=1:numel(packages),
+			[status,result]=system([ISSM_DIR '/externalpackages/ssh/pscp.exe -l "' username '" -pw "' password '" ' packages{i} ' ' host ':' path]);
+			if status, 
+				error('scpout error message: could not call putty pscp');
+			end
+		end
+		error;
+
+	else
+		%just use standard unix scp
+		%create string of packages being sent
+		string='';
+		for i=1:numel(packages),
+			string=[string ' ' packages{i}];
+		end
+		string=[string ' '];
+		[status,result]=system(['scp ' string host ':' path]);
+		if status, 
+			error('scpout error message: could not call scp on *nix system');
+		end
+	end
+end
