Project

General

Profile

Actions

Bug #2733

closed

pgrep/pkill prints misleading error on missing option argument

Added by Eric Schrock about 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Start date:
2012-05-14
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

If you specify an option to pkill/pgrep that requires an argument without said argument, you get a somewhat confusing "illegal option" error instead of a more helpful "missing argument" error.

$ pkill c
pkill: illegal option -
c
Usage: pkill [-signal] [-fnovx] [-P ppidlist] [-g pgrplist] [-s sidlist]
[-u euidlist] [-U uidlist] [-G gidlist] [-J projidlist]
[-T taskidlist] [-t termlist] [-z zonelist] [-c ctidlist] [pattern]

This should print 'missing argument' instead of 'illegal option'.

Actions

Also available in: Atom PDF