Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
well, we need cisco-like CLI for our embedded linux box. For 100 or so set/get/config commands. these cmds are written by respective developers. But, need CLI framework to hold them together. so tab completion, etc can done.
The shells (ksh at least and I think bash) do tab completion.
Just did a test with bash. Typed first two letters (ks) of a command and it showed me all the commands that start with ks. Did same thingk with rm and it did same. Is that what you're looking for?
There is a "set" built into shells - you need to do "man bash" (or "man ksh" if using ksh) for details.
Not familiar with the Cisco CLI so can't compare. It may be however that Cisco CLI is using embedded Linux - a lot of folks do.
Also be aware of the PATH variable. It tells your shell WHERE to find the scripts/commands. You can type echo $PATH to see what it is currently set to. The different elements are separated by colon so a $PATH displaying /bin:/sbin:/usr/local/bin would search for a command in each of those directories and use the first one found.
To add to existing PATH if your scripts/commands are in say /usr/local/ciscoset you simply type:
PATH=$PATH:/usr/local/ciscoset
The resulting echo $PATH (assuming you had the path seen earlier) would then show:
/bin:/sbin:/usr/local/bin:/usr/local/ciscoset
You can determine where it will find a given command by typing:
which command # For bash
whence command # For ksh
If it shows you a directory to the command it found it in PATH. If it shows no directory then it is a built in of the shell. (Example "echo" is a built in but there is also an "echo" binary command - sometimes you want to use the latter so its important to make sure you type the path when using it.)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.