Changeset a70441f in git for Singular/LIB/general.lib
- Timestamp:
- Apr 27, 2000, 12:07:30 PM (23 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- e5f8ae07e0b41bb1b0e5aaaac2dad244e619d563
- Parents:
- eec9b2d2a332c04f20d743bdd4ccc107766fbc61
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
reec9b2 ra70441f 1 // $Id: general.lib,v 1.2 5 2000-01-13 12:15:54obachman Exp $1 // $Id: general.lib,v 1.26 2000-04-27 10:07:13 obachman Exp $ 2 2 //GMG, last modified 18.6.99 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: general.lib,v 1.2 5 2000-01-13 12:15:54obachman Exp $";5 version="$Id: general.lib,v 1.26 2000-04-27 10:07:13 obachman Exp $"; 6 6 info=" 7 7 LIBRARY: general.lib PROCEDURES OF GENERAL TYPE … … 980 980 int rs; 981 981 int i; 982 string fn = " /tmp/which_" + string(system("pid"));982 string fn = "which_" + string(system("pid")); 983 983 string pn; 984 string cmd; 984 985 if( typeof(command) != "string") 985 986 { 986 987 return (pn); 987 988 } 988 i = system("sh", "which " + command + " > " + fn); 989 if (system("uname") != "ix86-Win") 990 { 991 cmd = "which "; 992 } 993 else 994 { 995 // unfortunately, it does not take -path 996 cmd = "type "; 997 } 998 i = system("sh", cmd + command + " > " + fn); 989 999 pn = read(fn); 990 pn[size(pn)] = ""; 991 i = 1; 992 while ((pn[i] != " ") and (pn[i] != "")) 993 { 994 i = i+1; 995 } 996 if (pn[i] == " ") {pn[i] = "";} 997 rs = system("sh", "ls " + pn + " > " + fn + " 2>&1 "); 1000 if (system("uname") != "ix86-Win") 1001 { 1002 // TBC: Hmm... should parse output to get rid of 'command is ' 1003 pn[size(pn)] = ""; 1004 i = 1; 1005 while ((pn[i] != " ") and (pn[i] != "")) 1006 { 1007 i = i+1; 1008 } 1009 if (pn[i] == " ") {pn[i] = "";} 1010 rs = system("sh", "ls " + pn + " > " + fn + " 2>&1 "); 1011 } 1012 else 1013 { 1014 rs = 0; 1015 } 998 1016 i = system("sh", "rm " + fn); 999 1017 if (rs == 0) {return (pn);} … … 1006 1024 example 1007 1025 { "EXAMPLE:"; echo = 2; 1008 which(" Singular");1009 } 1010 /////////////////////////////////////////////////////////////////////////////// 1026 which("sh"); 1027 } 1028 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.