Re: port details from the process id

2015-12-23 Thread Andrew Solomon
Hi Kamal Could you give us more detail on what the problem is? In what way are you using $port subsequent to this call? Without knowing anything else, my first guess is that your code does not account for the fact that there's a trailing newline in the string $port. If you call chomp($port);

port details from the process id

2015-12-23 Thread perl kamal
Hi, I am trying to retrieve the port details by the process id as like below, but it fails. my $port = `ss -l -p -n | grep $pid| grep -v grep 2>&1`; When I manually issue the command with the pid, it yields the output. Will you please suggest/correct me.Thanks.

Re: port details from the process id

2015-12-23 Thread Shlomi Fish
Hi perl kamal, On Wed, 23 Dec 2015 19:58:04 +0530 perl kamal wrote: > Hi, > I am trying to retrieve the port details by the process id as like below, > but it fails. > my $port = `ss -l -p -n | grep $pid| grep -v grep 2>&1`; > In addition to what Andrew said, note that