is this true for a shell script
In order for a file to be called from the command line and execute as a shell script on Unix, it must have a shebang (#!) line as one of its lines.
I know it...
Type: Posts; User: omega666
is this true for a shell script
In order for a file to be called from the command line and execute as a shell script on Unix, it must have a shebang (#!) line as one of its lines.
I know it...
So with the right parameters you can make it wait until more than one are ready to read from?
Are these three statements true?
The first one, i don't think its true because what sets up the pipes is the pipe() function.
The second one, isn't pipes one way, but sockets 2 way?
For the last...
if there were no space for the string, then how the the last printf statement print properly using the variable 'main->address' ?
whats the difference between printing with
h1.address and...
i still dont understand this
isnt main->address the same memory as h1.address ?
if the h1.address is currupt because of fitting more then 1 chars into a 1 char space
then why does the last print statement print properly
main->address: 45 Elmo Drive
isnt main->address the same...
how can that be a problem, since this is valid
char *test="hello";
if you use wait(NULL) in C, its supposed to wait until all child process's are completes first, but if u have a child that has another child does it wait until all these are exited? What if the first...
in this code
#include <stdio.h>
struct hospital {
int num_beds;
char code;
char *address;
};
i am using this
#!/usr/bin/env bash
curdir=`pwd`
while read line; do
printf $line
done < "test"
cd $curdir
yeah its linux, and i want to end the child because of an infinite loop, so it would really help if you can provide an example of how to do the signal code.
As well if you do know, i am trying to...
can someone provide an example, where if the parent process quits for any reason, then the child process will also close?
so what happens if it skips the accept, in a standard server file, because of non-blocking? will an error occur?
i added
fcntl(socket_fd, F_SETFL, O_NONBLOCK);
to the top, but still it hangs on...
so on this page
Beej's Guide to Network Programming
i click
select()
and
socket()
?
also i dont see
non blocking sockets.
i have a server client program where the server can connect with many clients, in the server it uses select function and accept. the program is about auctioning items, so i have it so after a certain...
nvm i got it now...
in my program i want to get the current time when the program starts, then be able to get the current time anytime later, I don't care how the format of the time is, but the thing is i want to be...
ok delete this thread then, since the other is fine
typedef struct item_list {
char *name;
char *number;
char *current_price;
char *high_bid;
struct item_list *next;
} item;
i changed it again to
check=0;
item *ptr = NULL;
for(ptr = item_list; ptr != NULL; ptr = ptr->next) {
if (strcmp(tmp_buffer1, ptr->number)==0) {
if...
i changed it to
item *node = NULL;
for(node = item_list; node != NULL; node = node->next) {
if (strcmp(node->number,tmp_buffer1)==0 &&...
shift(buffer,4);
tmp_buffer1 = malloc(strlen(buffer) * sizeof(char));
get_first_num(buffer,tmp_buffer1);
check = strlen(tmp_buffer1)+1;
shift(buffer,check);
check=0; item_num=0;...
can someone provide an example of a struct linked list, where it has strings as its values, and then how do I check if a specific string (say called buffer) exists in the list of structs?
i dont...
nvm i think i got it
in my code , i have trouble adding strings to list, and checking if they exist
before adding to the list i check if it already exists, if it does not, then i add it, but the problem is when i add...