c program to a utility


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting c program to a utility
# 1  
Old 12-16-2010
c program to a utility

Hi,
I have a c program file.c i want to make this code a utility to use again and again in unix. can you please tell how i can make .c code file into a utility.

Thanks

Last edited by Learnerabc; 12-16-2010 at 12:17 AM.. Reason: spelling
# 2  
Old 12-16-2010
Compile it and install into /usr/local/bin. If it dosn't already come with a manual (.man extension) it's well worth writing one, see this document for a quick how-to:

Writing and Formmating UNIX Manual Pages with -man macros

If you want to move into distributing it to many systems the next stage is to produce rpm packages (either binary distributions or source + makefile).
# 3  
Old 12-16-2010
Quote:
Originally Posted by Chubler_XL
Compile it and install into /usr/local/bin. If it dosn't already come with a manual (.man extension) it's well worth writing one, see this document for a quick how-to:

Writing and Formmating UNIX Manual Pages with -man macros

If you want to move into distributing it to many systems the next stage is to produce rpm packages (either binary distributions or source + makefile).
Thanks for reply brother but i didnt understand. I have a code in c program, let say to that count words in a file. this is a big code. now what i want is give that code a name( utility) to use in unix as a command ( man, echo etc etc)
# 4  
Old 12-16-2010
Hi you can use 'alias command'.
alias urUtilityName='/urpath/executableName' - This will not work, if u change the shell or reboot the system.
So add the same line in ur .profile, it will work always.
This User Gave Thanks to rajamohan For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl program get a response before the program quits

I created a program, so a kid can practice there math on it. It dispenses varies math problems and the kid must input an answer. I also want it to grade the work they have done, but I can't find the best place for it to print out the grade. I have: if ( $response =~ m/^/ ) { $user_wants_to_quit... (1 Reply)
Discussion started by: germany1517
1 Replies

2. Homework & Coursework Questions

Calling compiled C program with Perl program

Long story short: I'm working inside of a Unix SSH under a bash shell. I have to code a C program that generates a random number. Then I have to call the compiled C program with a Perl program to run the C program 20 times and put all the generated random #s into a text file, then print that text... (1 Reply)
Discussion started by: jdkirby
1 Replies

3. Programming

Python program faster than C++ program.

I wrote a simple program that generates a random word 10,000,000 times. I wrote it in python, then in C++ and compared the two completion times. The python script was faster! Is that normal? Why would the python script be faster? I was under the impression that C++ was faster. What are some of... (2 Replies)
Discussion started by: cbreiny
2 Replies

4. Shell Programming and Scripting

How to Unzip a file using unzip utility for files zipped without zip utility ?

Hi, I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server. How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

5. Shell Programming and Scripting

utility

hi experts, Can you please help me out in removing delimiters with in double quotes from a CSV file. input: ===== a,"bnn,",dgd, "sagfh,dj",ad output ===== a,"bnn",dgd, "sagfhdj",ad there are so mnay fileds in a row and there are millions of rows. Thanks in an advance.... (6 Replies)
Discussion started by: subhendu81
6 Replies

6. Programming

Help with a C program that acts like the make utility

Hi, I'm trying to create a C program that functions like the make utility in UNIX for personal use. My program would read in from a generic makefile and execute whatever is in that makefile but I'm not sure as to where I should start coding. I would appreciate any help. Thanks. (1 Reply)
Discussion started by: kratos.
1 Replies

7. UNIX for Dummies Questions & Answers

Script to open program and send/execute command in program

Hi, i want to write a script that executes a program (exec?) . this program then requires a filename as input. how do i give it this input in the script so the program will be complete run and close by the script. e.g. exec prog.exe program then asks for filename "enter filename:"... (1 Reply)
Discussion started by: tuathan
1 Replies

8. Programming

A program to trace execution of another program

Hi, I wanted to know if i can write a program using switches and signals, etc to trace execution of other unix program which calls c program internally. If yes how? If not with signals and switches then are there any other methods apart from debugging with gdb/dbx. (3 Replies)
Discussion started by: jiten_hegde
3 Replies

9. Shell Programming and Scripting

Program to replace "cut" utility

Hi guys, does any one have any tip about the command "cut"? i have a task to write a program (command) that would do the functions of cut. all ur tips approciated. Bachiri (2 Replies)
Discussion started by: abb058
2 Replies

10. UNIX for Dummies Questions & Answers

What utility do I use for this?

I want to pull out the 3rd column of information and stick in a file. What is the Utility I use to do this? (8 Replies)
Discussion started by: James
8 Replies
Login or Register to Ask a Question