Adding #!/bin/ksh to the start of a C language source file doesn't turn C source into a shell script. It creates a C language source file that can't be compiled because #!/bin/ksh is not a valid C language command.
Remove the line you added.
Change the name of the source file from a.out to thisfile.c.
Run the command suggested in the comment at the start of you example:
And, then, if the cc command completes successfully run the compiled code:
or:
If you haven't looked at the code to see why I specified 0 and 1 as possible arguments, run it with no arguments and follow the directions it prints.
This User Gave Thanks to Don Cragun For This Post:
Hi,
I have a program that runs two threads in stead of two processes. I want to use pipe to redirect the output of the first thread to the input of the second thread.
One thread is continuously writing to a pipe, and the other thread will read from the pipe.
How do I do that?
Is there... (2 Replies)
Hi All,
Please explain me when i have to use multiple process and when I have to use Multiple threads? Please give me an example.It will be very helpful for me.
Thanks in advance. (0 Replies)
Hi,
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks (5 Replies)
Hi Friends,
I am designing a solution for a problem: in which my master thread receiving network message and processing them, during processing of each message i need to communicate remote database (that is actually a separate external module)that cause a delay of arount 2 second (), After... (1 Reply)
Hi,
Can anyone give me any idea when multiple processes access a file (like opening it, modifying it etc.) how can the synchronization can be done if they can access the same file at any time? How can this scenario is different from when multiple threads access a same file, modifying it etc- in... (7 Replies)
Hello all,
I have a directory of files of varying sizes.
I want to copy all these files in n number of threads to another directory such that each
copy set is more or less the same size.
Example :
Say /mydirA
It has around say 23 files of various sizes.
Number of copy... (0 Replies)
Hi all,
Can I create multiple threads using single thread_id
like
pthread_t thread_id;
pthread_create(&thread_id, NULL, &print_xs, NULL);
pthread_create(&thread_id, NULL, &print_ys, NULL);
pthread_create(&thread_id, NULL, &print_zs, NULL);
pthread_join(thread_id, NULL);
what... (2 Replies)
Hi,
I have a list of URLs in a csv file which I'm checking for page status. It just prints the URL and the status as output. This works perfectly fine.
I'm looking to run this in multiple threads to make this process faster.
I'm pretty new to Perl and I managed to complete this. It would be... (9 Replies)
Hi , i need to run multiple scripts parallely ,on my server....i have 8 cpus . planning to run minimum of 6 scripts paralley ....could you please suggest someone .
thanks in advance , (3 Replies)