![]() |
|
|
grep unix.com with google
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Our Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Problem with `cat` the compiled output of C program in unix
Hello All, I have coded a C program which looks something like below... (program name: test.c) Code:
#include<stdio.h>
main()
{
int dist,dm,dcm;
printf(" Enter the distance between 2 cities in KM : ");
scanf("%d",&dist);
dm=dist*1000;
dcm=dist*10;
printf("Distance between 2 cities in Meter is %d \n",dm);
printf("Distance between 2 cities in centi-meters is %d \n",dcm);
return 0;
}
when compile this in unix by using the below command Code:
cc test.c I will get the compiled output as a.out which i need to give to my team members... Now My problem is....! If someone by mistake try to see what is there inside the a.out by using cat a.out it will start to BEEP and will not stop for while... I dont want this to happen... it should just show the weird language inside the a.out file without any sound....how can i do that? Thank you. Regards, smarty86. ---------- Post updated at 06:59 AM ---------- Previous update was at 05:54 AM ---------- And also one more thing I'm using HP-UX m/c.. so zip is not working in that.. is there any other way to zip in HP-UX m/c? |
|
|||
|
Quote:
whatever.. even if they compile and then they do cat of the compiled file the same thing happens... i dont want that BEEP to come... so.. please help me |
|
|||
|
Off topic. Beware of calling a program "test". It is the name of a unix command.
Maybe tell your colleagues about the "file" command which will tell them whether a file is "text" and therefore suitable for reading with "cat". The beep usually comes from a byte containing Hex 07 - meaning a terminal bell character in a text file (which program object code isn't). |
|
|||
|
I lol'd hard at this ^_^ |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connection problem with gui java program to postgreaql database using unix | uci | UNIX for Dummies Questions & Answers | 2 | 12-15-2007 09:16 AM |
| C program Output | arunviswanath | High Level Programming | 3 | 07-05-2007 02:16 AM |
| How to use a .exe with a compiled program. | adamsy | High Level Programming | 1 | 10-04-2005 01:03 AM |
| Capturing output from C++ program | GMMike | UNIX for Dummies Questions & Answers | 3 | 03-08-2005 09:04 AM |
| Running a compiled Program | Krebsbac | High Level Programming | 2 | 09-07-2001 05:39 PM |