git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6315 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -777,16 +777,24 @@ void Input::shell()
|
||||
} else if (strcmp(arg[0],"rm") == 0) {
|
||||
if (narg < 2) error->all("Illegal shell command");
|
||||
if (me == 0)
|
||||
for (int i = 1; i < narg; i++)
|
||||
unlink(arg[i]);
|
||||
for (int i = 1; i < narg; i++) unlink(arg[i]);
|
||||
|
||||
} else if (strcmp(arg[0],"rmdir") == 0) {
|
||||
if (narg < 2) error->all("Illegal shell command");
|
||||
if (me == 0)
|
||||
for (int i = 1; i < narg; i++)
|
||||
rmdir(arg[i]);
|
||||
for (int i = 1; i < narg; i++) rmdir(arg[i]);
|
||||
|
||||
} else error->all("Illegal shell command");
|
||||
// use work to concat args back into one string separated by spaces
|
||||
// invoke string in shell via system()
|
||||
|
||||
} else {
|
||||
strcpy(work,arg[0]);
|
||||
for (int i = 1; i < narg; i++) {
|
||||
strcat(work," ");
|
||||
strcat(work,arg[i]);
|
||||
}
|
||||
if (me == 0) system(work);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user