ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
He said that he wants to have a command of his own, which he can use like the built-in ones like ls, or cd. I think that could be achieved by putting an executable into the same folder where the other commands reside. Feel free to call me crazy.
Last edited by steve296; 07-11-2010 at 11:29 AM.
Reason: typo
He said that he wants to have a command of his own, which he can use like the built-in ones like ls, or cd. I think that could be achieved by putting an executable into the same folder where the other commands reside. Feel free to call me crazy.
So, stating that you can write a program, how did you check the programs you'd written ?
Assume that I have a .c file and that I have written in Linux and rcompiled that using gcc compiler and when I run the executable it gives me the desired output.
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
Umm.. yeah, sorry for failing basic computer science rigor.
*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.
Assume that I have a .c file and that I have written in Linux and rcompiled that using gcc compiler and when I run the executable it gives me the desired output.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.