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); this will be removed. Andrew On Wed, Dec 23, 2015 at 2:28 PM, perl kamal <kamal.p...@gmail.com> 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`; > > When I manually issue the command with the pid, it yields the output. > Will you please suggest/correct me.Thanks. > > -- Andrew Solomon Mentor@Geekuni http://geekuni.com/ http://www.linkedin.com/in/asolomon