From 7b6539f84bf8d8a7a08dc20e6aa5eff652ea982f Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Sun, 12 Jan 2020 09:27:03 +0100 Subject: [PATCH] pidcmd: Allow for more arguments --- pidcmd/pidcmd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pidcmd/pidcmd b/pidcmd/pidcmd index 8331908..aed2e48 100755 --- a/pidcmd/pidcmd +++ b/pidcmd/pidcmd @@ -10,7 +10,7 @@ pidcmd - Show the command run by a pid =head1 SYNOPSIS -B I +B I =head1 DESCRIPTION @@ -29,11 +29,14 @@ Show the command for pid 1 pidcmd 1 +Show the command for pid 1000 and 1002 + pidcmd 1000 1002 + =head1 AUTHOR -Copyright (C) 2019 Ole Tange, +Copyright (C) 2019-2020 Ole Tange, http://ole.tange.dk and Free Software Foundation, Inc. @@ -67,4 +70,7 @@ B =cut -cat /proc/$1/cmdline | xargs -0 +for pid in "$@"; do + cat /proc/$pid/cmdline | xargs -0 +done +