LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-01-2013, 01:38 AM   #1
AbidDhanaiser
Member
 
Registered: May 2013
Location: Faisalabad, Pakistan
Posts: 72

Rep: Reputation: Disabled
How to make a custom program in centOS


How to make a custom program in centOS
i want to create my own program in centOS ,
e.g
if a write user programmer and then i execute it like ..
to shutdown a pc i just enter
#sd (sd>>shut down )


so system centOS should shutdown
 
Old 06-01-2013, 02:27 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
I'm not sure what you are after. A custom program can be anything from a program written in a higher language (C, JAVA, ...), a script (Perl, awk, bash, ...) or even an alias or function based on an already existing program.

The example you give can be accomplished by an alias:
Code:
alias sd='shutdown'
Add this alias to your /etc/profile (for global usage) or in ~/.bashrc to make it local.

If this is not what you are after then please explain a bit more.

BTW: The shutdown command needs root permissions.
 
Old 06-01-2013, 02:34 AM   #3
AbidDhanaiser
Member
 
Registered: May 2013
Location: Faisalabad, Pakistan
Posts: 72

Original Poster
Rep: Reputation: Disabled
thanks
actually i want to write a c++ program and want to execute it .
 
Old 06-01-2013, 02:45 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by AbidDhanaiser View Post
thanks
actually i want to write a c++ program and want to execute it .
In that case you need to learn C++

There are many on-line articles that can help you. Feed your search engine with Linux C++ Programming HOWTO and take your pick.

EDIT: Looking for something else I just ran into this right here at LQ: C/C++ TUTORIALS

Last edited by druuna; 06-01-2013 at 03:23 AM. Reason: Added LQ link
 
  


Reply



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
How to make a custom program in centOS AbidDhanaiser Linux - Newbie 1 05-29-2013 06:57 AM
CentOS Custom Partition Candykitten Linux - Newbie 1 02-24-2012 06:30 PM
Custom CentOS 5 Install with ks.cfg file and centOS all in one linux_newb Linux - Server 1 01-14-2010 06:13 PM
make a .img file for custom liveCD, dd?? (Also, how to make your system very small) 1veedo Linux - Newbie 6 05-07-2006 05:52 PM
Key bindings program (custom pasting, program execution, etc.) jrdioko Linux - Software 2 02-05-2005 09:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:41 AM.

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