in reply to checking command suggestions with Net::SSH::Expect
For a more portable approach, to the solution to the first problem, it's also rather trivial to break PATH into a list of directories, then to use find to facilitate the listing of their contents in terms of their full path location:
Or as sent via an ssh command,for d in $(echo $PATH | tr ':' '\n'); do find $d -type f; done
find is also pretty darn flexible, and if you do not wish to use it then there are other utilities you may use to list the contents of each directory in PATH like ls.ssh you.remote.host "for d in \$(echo \$PATH | tr ':' '\n'); do find \ +$d -type f; done"
|
|---|