Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-05-2011, 02:09 PM   #1
Registered: May 2009
Distribution: slackware, fedora, ubuntu
Posts: 101

Rep: Reputation: 21
creating a new binary

I need to change the functions of some linux commands. We can't edit the binary files provided in /bin, is there any other method other than alias.
For ex. - I need to change the function chmod so that it takes only three consecutive integers as input (chmod 777 filename) and nothing else ?
Do I have to write by own code for it, or is there any other alternate method.
Old 01-05-2011, 02:23 PM   #2
Senior Member
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: Disabled
I think it would be better you describe what you want to achieve. I don't think that writing your own commands is a good Idea.

Old 01-05-2011, 02:24 PM   #3
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.0
Posts: 1,336

Rep: Reputation: 255Reputation: 255Reputation: 255
What's so bad with the original command? You could define a function and hide it from the user. Inside the function you can check for the proper arguments and call the real binary:

$ function chmod { echo "Hello"; }
$ chmod
Be aware, that either the user could still call the original command, or even install his own version.


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
creating binary for C code ravish.kanika Linux - Newbie 2 02-27-2008 06:46 AM
fstream.h is creating erratic binary programs sriram_16a SUSE / openSUSE 0 10-02-2007 01:48 AM
Creating/Distributing Linux Binary Files Sava Programming 3 08-29-2006 10:31 AM
Creating binary RPMS statically! Sunilsbjoshi Linux - Software 2 10-12-2005 01:10 AM
creating a flat binary file with gcc wsimmons Programming 2 01-08-2002 12:33 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:23 AM.

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