.IR omitpid[,omitpid..] ]
.RB [ \-o
.IR omitpid[,omitpid..].. ]
+.RB [ \-S
+.IR separator ]
.B program
.RB [ program.. ]
.SH DESCRIPTION
Tells \fIpidof\fP to omit processes with that process id. The special
pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
program, in other words the calling shell or shell script.
+.IP "-S \fIseparator\fP"
+Use \fIseparator\fP as a separator put between pids. Used only when
+more than one pids are printed for the program.
.SH "EXIT STATUS"
.TP
.B 0
fputs(_(" -c, --check-root omit processes with different root\n"), fp);
fputs(_(" -x also find shells running the named scripts\n"), fp);
fputs(_(" -o, --omit-pid <PID,...> omit processes with PID\n"), fp);
+ fputs(_(" -S, --separator SEP use SEP as separator put between PIDs"), fp);
fputs(USAGE_SEPARATOR, fp);
fputs(USAGE_HELP, fp);
fputs(USAGE_VERSION, fp);
int found = 0;
int first_pid = 1;
- const char *opts = "scnxmo:?Vh";
+ const char *separator = " ";
+ const char *opts = "scnxmo:S:?Vh";
static const struct option longopts[] = {
{"check-root", no_argument, NULL, 'c'},
{"single-shot", no_argument, NULL, 's'},
{"omit-pid", required_argument, NULL, 'o'},
+ {"separator", required_argument, NULL, 's'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
pidof_root = pid_link(getpid(), "root");
}
break;
+ case 'S':
+ separator = optarg;
+ break;
case 'V':
printf (PROCPS_NG_VERSION);
exit (EXIT_SUCCESS);
first_pid = 0;
printf ("%ld", (long) procs[i].pid);
} else {
- printf (" %ld", (long) procs[i].pid);
+ printf ("%s%ld", separator, (long) procs[i].pid);
}
if (opt_single_shot) break;
}