LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-14-2011, 09:59 AM   #16
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060

Quote:
Originally Posted by Stephen Morgan View Post
I believe cd is a shell built-in command, rather than a programme with its own source code.
Well, duh! Yup, cd is definitely part of the shell -- of course, one could modify the source to change the behavior of cd but that may be equivalent to those little dancing dogs you see in the circus: the question is not how well but rather why at all, methinks.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 11-14-2011, 03:31 PM   #17
venom4u31
Member
 
Registered: Oct 2011
Distribution: Debian 6
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MTK358 View Post
I don't know why anyone marked this as unhelpful, because it's true.

In fact, it's impossible to create a separate program that changes the current directory of the shell, since each process (including the shell and command) has its own separate current directory.
Relax, it's not that unhelpful. I was only asking about reverse engineering the code from the executable (in the case of compiled programs), which I believe that most of the installed programs are.
 
Old 11-14-2011, 03:51 PM   #18
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,226

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
there are two different types of commands
'internal' and 'external' commands
internal commands are part of the shell
external commands are separate binaries that are executed by the shell
a lot of the basic commands that are not internal commands (such as ls) can be found in the 'coreutils' package
 
Old 11-15-2011, 08:15 PM   #19
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
The thing to be clear on, is that whether the cmd is part of the shell, or 'external', Linux is FOSS (Free & Open Src SW).
This means that the src code should be available from your normal repos. Most distros don't install the src code by default, because most people don't want/need it.

Note that some distros also give access to non-open SW.
That would involve reverse engineering, which is likely illegal ... depending on jurisdiction/reason for doing so etc.

What Sw do you want to see the src for?
 
Old 11-15-2011, 08:48 PM   #20
opensourcewj
LQ Newbie
 
Registered: Jan 2010
Location: Beijing,China
Posts: 12

Rep: Reputation: 0
"man alias" you will get what you want.
 
Old 11-15-2011, 09:17 PM   #21
Roken
Member
 
Registered: Oct 2011
Location: Bolton, UK
Distribution: Arch local, Debian on VPS
Posts: 258

Rep: Reputation: 41
On the off chance that anyone does want to modify a shell built in function, you can get the source for the shell and modify to your hearts content. As has been said many times in this thread, FOSS (Free open source software) is exactly what it says on the tin, open source. If the source hasn't been made readily available, and if you know it's covered by the gnu license, ask the package author for the source (he'll supply it under the terms of the license).

As has also been said, you hit a problem with closed source propriety stuff (which most of GNU/linux isn't) but beyond that the world is your oyster.
 
  


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
Edit Command Verbal Kint Linux - Software 2 06-14-2007 12:37 AM
How do I edit files in command line sweb74 Linux - Newbie 13 01-27-2004 11:53 PM
Edit from Command Prompt Paul Mon Linux - General 4 09-22-2003 09:20 PM
how to edit a file when not in X (ie from the command line) ludwig W Linux - Newbie 12 04-22-2003 05:00 AM
what is the command to edit ultravox Linux - General 5 04-06-2003 06:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:00 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration