Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: checking command suggestions with Net::SSH::Expect

by perlfan (Vicar)
on Jul 04, 2020 at 07:05 UTC ( [id://11118899]=note: print w/replies, xml ) Need Help??


in reply to checking command suggestions with Net::SSH::Expect

My initial thought was to search your PATH, but if you know what you want which is certainly the tool you should use as suggested below. I also thought at first you wished to trigger the the bash readline support for history, ctrl-r. If that's the case (probably not), then you may also wish to directly peek at $HOME/.bash_history.

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:

for d in $(echo $PATH | tr ':' '\n'); do find $d -type f; done
Or as sent via an ssh command,
ssh you.remote.host "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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-04-25 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found