LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 02-17-2006, 12:38 PM   #1
roswel
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Rep: Reputation: 0
q:HowTo Design CLI


well folks,

i am looking to implement CLI (command line interface) s/w for bunch of set/get commands in linux. more like cisco cli.

any design hints?..or better, any free or reference source code?

thanks
roswel
 
Old 02-17-2006, 01:20 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
CLI as opposed to GUI?

bash is a CLI shell.

Are you in Gnome or KDE and wanting to go to command line? Just open a "terminal" or "console" this will give you shell (CLI) prompt.
 
Old 02-17-2006, 02:19 PM   #3
roswel
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Original Poster
Rep: Reputation: 0
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.
 
Old 02-18-2006, 09:08 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.)
 
Old 02-18-2006, 09:21 AM   #5
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
Another option could be using something like dialog for a curses based environment.


Håkan
 
Old 02-21-2006, 09:15 AM   #6
roswel
LQ Newbie
 
Registered: Jan 2006
Posts: 8

Original Poster
Rep: Reputation: 0
thanks for your detailed replys.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux for Graphic Design, web design, and publishing maelstrom209 Linux - Software 8 07-17-2011 11:35 AM
Howto Boot to CLI w/ Debian Sarge 3.1 renato167 Debian 3 10-25-2005 02:42 AM
howto identify what services are running via CLI? Lleb_KCir Linux - General 3 09-21-2004 11:44 PM
Howto update KDE and howto switch off kdm/gdm Canaris Linux - Software 1 06-15-2003 08:40 PM
OS Design Shak Programming 2 08-26-2002 04:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration