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. |
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.
Markus |
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:
Code:
$ function chmod { echo "Hello"; } |
All times are GMT -5. The time now is 06:50 PM. |