Sunday, May 27, 2018

command line - How do I create a program similar to 'fortune', that can be installed using apt-get install

I am trying to create a program, let's call it abcd like http://linux.die.net/man/6/fortune that can simply be installed like $ sudo apt-get install abcd. Now for the specifics, my program simply is fetching data from and API and printing it.




The API is already built. I can write a script in any language viable to access the API, extract data and print it.



Now, I want my script to function as follows. Anyone who wishes to install it should do sudo apt-get install abcd. After this, the user only has to type in $ abcd in the shell and the output will appear. Also, it can accept 3-4 parameters like $ abcd -typeA which will print different data.



What is the process to create such a program and get it up and running?



I am new to linux. I really want this done. Thanks for help in advance.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...