Implementing my own Command
Hi,
I want to have a command of my own. Let the command name is MyDate and it shows the date and time. what I need to do for that? What are the steps I need to follow? When I am in the console, I want to use it same way I use the other commands like cd,ls etc Please guide |
Quote:
Quote:
When the question has no substance unfortunately so do the answers. |
You can write a script in BASH, Python, and many other languages.
You can create an alias based on existing commands. |
It sounds like what you're talking about is using a Bash function. You can find a real quick, easy tutorial for making one. Otherwise, there are a lot of languages to do it with or aliases, as was suggested.
|
I want to use c or c++ language for that.
|
Quote:
|
Yes, I can write a program or write a library which gives me the date and time.
Suppose I have the exe or lib which gives me the desired output then what I need to do to execute it on the console as command like ls,cd etc |
Quote:
|
As far as I know, the console commands are found in /bin and /usr/bin. It may suffice to just put the executable into /usr/bin.
|
Quote:
What for/why ? |
Quote:
|
Quote:
Built-in into what ? |
Quote:
suppose that exe is int the /usr/Hoge/Test then I am able to run that like ./executablefile I want that I should run that execuatable from any path and without giving command like ./executablefile I want to give just executablefile (as ls and cd command) from any path |
Quote:
*starts to write down what he means, but decides that its stupid and cuts it out* Let's just skip this, I mean the commands that he can use without going into the folder where the executable resides, and run it from there (or otherwise referencing the full path). Sorry, linux newbie here. |
Quote:
bash aliases and PATH environment variable . |
All times are GMT -5. The time now is 04:18 PM. |