08-12-2012
Reason you are getting no output is you used different case for fhconditions in open and while lines.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi
I have a C++ program that generates a lot of log information on the console, I need this output (printed using printf function) to go to a file since I will use crontab to schedule the job.
I know I can do this:
myprog > myfile
but I don't know how to enter this in crontab.
I use... (3 Replies)
Discussion started by: GMMike
3 Replies
2. UNIX for Dummies Questions & Answers
Hello
I wander if im doing :
ls -l and its giving me lets say 3 results :
-rw-r--r-- 1 blah other 1789 May 19 2003 foo.c
-rw-r--r-- 1 blah other 1014 May 19 2003 foo.h
-rw-r--r-- 1 blah other 270 May 19 2003 foo1.c
now I would like to use the first... (1 Reply)
Discussion started by: umen
1 Replies
3. Programming
The output I got for this pgm is "4 4 4 4".
Can any one help me to understand how I got this output.
Also please suggest me some links to learn about argumnets evaluation in C.
# include <stdio.h>
void func(int a, int b, int c, int d)
{
printf("%d %d %d %d", a, b, c, d);
}
int... (3 Replies)
Discussion started by: arunviswanath
3 Replies
4. Programming
1 #include <fcntl.h>
2
3 main(int argc, char *argv)
4 {
5 char buf;
6 int fd, count = 0;
7
8 if (argc > 1)
9 fd = open(argv, O_RDONLY);
10 else
11 fd = 0; /* Use standard input */
12
13 while (read(fd, buf, 1) > 0) {
14 if (count < 5) write(1, buf, 1);
15 ... (3 Replies)
Discussion started by: bishweshwar
3 Replies
5. UNIX for Dummies Questions & Answers
I Wrote code that forks into two processes, a parent process, and a child process. The parent process will take the arguments to main() and send them one character at a time to the child process through a pipe (one call to write for each character). The child process will count the characters... (1 Reply)
Discussion started by: hansel13
1 Replies
6. Homework & Coursework Questions
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
7. Programming
Hello All,
iam a new memeber today i joined this forum.
hope i will get help. the below program takes input strings and give reverse of input string.
&& mv /home/test1/programs/display /home/test1/programs/old
echo " Please enter the test "
read a
echo "$a" > file
wc -c file > file1
perl... (1 Reply)
Discussion started by: ameyrk
1 Replies
8. Shell Programming and Scripting
Hi All,
I have created a sample perl program in one of the unix environment as below
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>";
When I execute it in unix, I get the below
Content-type: text/html
<H1>Hello World</H1>
However, when I... (1 Reply)
Discussion started by: mr_manii
1 Replies
9. Shell Programming and Scripting
can anyone help me out to write a code by connecting to the sql database and I need to print the list of tables present in the databse.
any ideas please. (1 Reply)
Discussion started by: ramkumar15
1 Replies
10. Shell Programming and Scripting
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
LEARN ABOUT LINUX
megaco_transport
megaco_transport(3erl) Erlang Module Definition megaco_transport(3erl)
NAME
megaco_transport - Megaco transport behaviour.
DESCRIPTION
The following functions should be exported from a megaco_transport callback module:
* send_message/2 [ mandatory ]
* send_message/3 [ optional ]
* resend_message/2 [ optional ]
*
EXPORTS
Module:send_message(Handle, Msg) -> ok | {cancel, Reason} | Error
Module:send_message(Handle, Msg, Resend) -> ok | {cancel, Reason} | Error
Types Handle = term()
Msg = binary() | iolist()
Resend = boolean()
Reason = term()
Error = term()
Send a megaco message.
If the function returns {cancel, Reason} , this means the transport module decided not to send the message. This is not an error. No
error messages will be issued and no error counters incremented. What actions this will result in depends on what kind of message
was sent.
In the case of requests, megaco will cancel the message in much the same way as if megaco:cancel had been called (after a success-
full send). The information will be propagated back to the user differently depending on how the request(s) where issued: For
requests issued using megaco:call , the info will be delivered in the return value. For requests issued using megaco:cast the info
will be delivered via a call to the callback function handle_trans_reply .
In the case of reply, megaco will cancel the reply and information of this will be returned to the user via a call to the callback
function handle_trans_ack .
The function send_message/3 will only be called if the resend_indication config option has been set to the value flag . The third
argument, Resend then indicates if the message send is a resend or not.
Module:resend_message(Handle, Msg) -> ok | {cancel, Reason} | Error
Types Handle = term()
Msg = binary() | iolist()
Reason = term()
Error = term()
Re-send a megaco message.
Note that this function will only be called if the user has set the resend_indication config option to true and it is in fact a mes-
sage resend. If not both of these condition's are meet, send_message will be called.
If the function returns {cancel, Reason} , this means the transport module decided not to send the message. This is not an error. No
error messages will be issued and no error counters incremented. What actions this will result in depends on what kind of message
was sent.
In the case of requests, megaco will cancel the message in much the same way as if megaco:cancel had been called (after a success-
full send). The information will be propagated back to the user differently depending on how the request(s) where issued: For
requests issued using megaco:call , the info will be delivered in the return value. For requests issued using megaco:cast the info
will be delivered via a call to the callback function handle_trans_reply .
In the case of reply, megaco will cancel the reply and information of this will be returned to the user via a call to the callback
function handle_trans_ack .
Ericsson AB megaco 3.15.1 megaco_transport(3erl)