LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-16-2003, 09:20 PM   #1
AMDPwred
Member
 
Registered: Dec 2001
Location: Richmond, VA
Posts: 391

Rep: Reputation: 30
2 Questions...


1. Does anyone know where I can go to learn more about how a Linux system works from an architecture point of view? I understand the basic concept of an OS (Command -> System -> Kernel), but I really want to get specifics on the Linux systems.

2. Say I wanted to add my own little function in Linux. Now I'm not really sure where it would need to go, so stay with me here. I'd basically like to be able to say "chris -message" (just like 'man', 'rm', etc) in the command line and get some random message printed out. Instead of writing my own program to do so, I'd like this built into the kernel (again, I'm not sure if it's build into the kernel or command level system).

Any input is very welcome! Thanks.
 
Old 06-16-2003, 10:07 PM   #2
contrasutra
LQ Guru
 
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445

Rep: Reputation: 47
Well, for your second question, you can use Bash Aliases.

in your /home/user/.bashrc file (you may have to create it) , add things like:

alias "chris -message"="fortune"

Now whenever you type "chris -message" at a command line, the "fortune" command will be executed. This is just an example.
 
Old 06-17-2003, 12:15 AM   #3
AMDPwred
Member
 
Registered: Dec 2001
Location: Richmond, VA
Posts: 391

Original Poster
Rep: Reputation: 30
Not quite what I'm lookin for...
 
Old 06-17-2003, 01:01 AM   #4
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Could you expand more on what you are looking for then? I started to reply with the above option, but figured you meant something else. But couldn't really figure out what?

Cool
 
Old 06-17-2003, 01:06 AM   #5
AMDPwred
Member
 
Registered: Dec 2001
Location: Richmond, VA
Posts: 391

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by MasterC
Could you expand more on what you are looking for then? I started to reply with the above option, but figured you meant something else. But couldn't really figure out what?

Cool
I was going to write a little source file in C that returns a phrase or something (doesn't really matter what) when I type my name in the command line. Just like you can type rm, ls, df, etc, into the command line and do stuff, I want to do the same. I don't know whether I need to add code to the kernel, then recompile it and boot into it. Or do I need to edit the shell code I use, recompile it and so on. That's what I'm trying to figure out.

Does that make better sense?
 
Old 06-17-2003, 01:31 AM   #6
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
Sure. Whatever you call yout binary that you create with C (I'm quite rusty on programming, but I think it's an a.out binary or elf binary right, well whatever you rename a.out to) simply place that in your PATH and call it just like you do with ls and such.

Is that what you mean? If you need help with the code that's a different story, but scripting it to call something would be a piece of cake.

Cool
 
Old 06-17-2003, 01:35 AM   #7
AMDPwred
Member
 
Registered: Dec 2001
Location: Richmond, VA
Posts: 391

Original Poster
Rep: Reputation: 30
I know I could do it that way, by just writing a program and adding it to my path. So when I ran the command, the system picked it up.

But, I was hoping to intergrate this into my system from a kernel level or something.
 
Old 06-17-2003, 02:06 AM   #8
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
I'm not really sure I see the point, other than just doing it. ls cp and modprobe aren't kernel level programs. Do you mean to write a daemon? Still wouldn't be too hard, look into xinet.d and inetd.

Possibly look into kernel patches to see if that's what you are talking about.

Cool
 
Old 06-17-2003, 02:12 AM   #9
AMDPwred
Member
 
Registered: Dec 2001
Location: Richmond, VA
Posts: 391

Original Poster
Rep: Reputation: 30
There really is no "point". I just wanna fool around I guess.
 
Old 06-17-2003, 02:15 AM   #10
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69


Sounds cool then I think for an application like that, daemons would be as close as I'd go.

Cool
 
Old 06-17-2003, 04:51 AM   #11
MasterC
LQ Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu ; CentOS ; Raspbian
Posts: 12,613

Rep: Reputation: 69
http://freshmeat.net/projects/kml/

Would that be something you may be interested in?



Cool
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
basic questions on hostname and domain name + related postfix questions Moebius Linux - Newbie 7 09-04-2007 11:50 AM
Solaris - Questions! Questions! Questions! qs_tahmeed Solaris / OpenSolaris 2 07-16-2005 05:27 AM
window manager questions and/or theme questions t3gah Linux - Software 2 02-27-2005 04:16 PM
Some questions... CryptDragoon Linux From Scratch 2 02-04-2004 08:28 PM
few questions? pudhiyavan Linux - General 2 10-03-2003 07:35 AM

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

All times are GMT -5. The time now is 03:37 AM.

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