On Tue, Oct 22, 2013 at 02:34, Alexander Hall wrote:
> On 10/22/13 02:09, Ted Unangst wrote:
>> I don't think the -l flag to pkill is useful. It's behavior is oddly
>> different from pgrep -l (and more different with pgrep/pkill -f). Or
>> rather, it's not just long output, but also turns on verbose mode when
>> otherwise nothing would be printed. The only use case I can think of
>> is "did I kill the right process?" which is literally the kind of shoot
>> first, ask questions later behavior we should maybe not encourage.
> 
> I tend to pgrep -fl for a process to kill, and then I always have to
> think about which switch to remove. Being as tightly coupled as they
> are, I think allowing -l for both is helpful.
> 
> I agree the output is inconstistant, but I'd rather have that fixed (if
> possible) than it being removed.
> 
> 
> $ sleep 50 &
> [1] 2673
> $ pgrep -fl sleep
> 25664 sleep 5
> 2673 sleep 50
> $ pgrep -fl 'sleep 50'
> 2673 sleep 50
> $ pkill -l 'sleep 50'
> $ pgrep -fl 'sleep 50'
> 2673 sleep 50
> $ #fuck
> $ pkill -f 'sleep 50'
> [1] + Terminated           sleep 50

This is exactly the problem I experience. I didn't want to rely solely
on "I can't remember which flag to use", but yes, that is the root of
the problem.

Removing support for -l causes it to be a hard error, that one will
notice, as opposed to a silent failure.



Reply via email to