Search Results

Search: Posts Made By: gaurav1086
Forum: Programming 11-06-2012
3,080
Posted By gaurav1086
Hi, In Unix, the main function can usually...
Hi,

In Unix, the main function can usually return any int value as its status, which is captured by the OS. You can always see the return value of any program by simply doing echo $?

For...
Forum: Programming 06-29-2011
3,273
Posted By gaurav1086
Hello, Can you provide the code that you...
Hello,

Can you provide the code that you tried but it failed. ?

Thanks,
Gaurav.
Forum: Programming 06-27-2011
3,273
Posted By gaurav1086
Hi, you can use shared_memory IPC to share...
Hi,

you can use shared_memory IPC to share the sockets(any data) between the two processes via a unique key. Otherwise you can instead create threads when you serve a new request. Then you save...
Forum: Programming 06-21-2011
2,978
Posted By gaurav1086
cat + perl + sed = WOW !!! ---------- Post...
cat + perl + sed = WOW !!!

---------- Post updated at 02:06 PM ---------- Previous update was at 02:00 PM ----------




perl -wln -e 'print if (!/^\$/ and /^MG/)' FILE.txt


With perl...
Forum: Programming 06-21-2011
8,814
Posted By gaurav1086
Hello Madhu, From the error, its obvious...
Hello Madhu,

From the error, its obvious that you need the libnsl.a because code links against some routines from that lib. What I would suggest is that find that library (using find) and...
Forum: Programming 06-17-2011
8,502
Posted By gaurav1086
Hi, From the man page - SIGINT is sent...
Hi,

From the man page -
SIGINT is sent when the user on the process' controlling (http://en.wikipedia.org/w/index.php?title=Controlling_terminal&action=edit&redlink=1) terminal...
Forum: Programming 06-16-2011
8,502
Posted By gaurav1086
Hello dragon, Do you have access to the...
Hello dragon,

Do you have access to the source ? If yes, can you post if over here (only the relevant part) ..

Thanks,
Gaurav.
Forum: Programming 05-06-2011
2,651
Posted By gaurav1086
Hi, 'cd' command is not part of the kernel....
Hi,

'cd' command is not part of the kernel. though it is the part of the shell. Its a shell built-in. The other commands are external to the shell like 'file', 'find' . If a command is shell...
Forum: Programming 05-06-2011
21,757
Posted By gaurav1086
Hi , You can use sizeof() operator to find...
Hi ,

You can use sizeof() operator to find the size of any data structure by providing the base address of the structure. the implementation of memory allocation are different on different...
Forum: Programming 05-06-2011
5,552
Posted By gaurav1086
Hi, run it on gdb to print the...
Hi,

run it on gdb to print the value(address) of v where you allocate it and where you free it to see if its getting corrupted by some other thread. So far what you have pasted looks okay to me....
Forum: Programming 05-02-2011
13,906
Posted By gaurav1086
Hi royalibrahim, The declaration 'char *a =...
Hi royalibrahim,

The declaration 'char *a = "hello"' is actually allocated in the .rodata (read-only data) and not in the .text section (in an ELF binary). I wrote a small code to verify
this....
Forum: Programming 04-27-2011
3,434
Posted By gaurav1086
Hi, printf("%s",&3[p]); 3[p] is...
Hi,


printf("%s",&3[p]);


3[p] is a character whereas %s needs the address of a character buffer.

Thanks,
Gaurav.
Forum: Programming 04-24-2011
6,088
Posted By gaurav1086
Hi Peter, A preprocessor directive such as...
Hi Peter,

A preprocessor directive such as you see "#define" or "#include" is translated by the preprocessor (cpp) before the compiler gets its hands dirty with the code. For example if you...
Forum: Programming 04-06-2011
9,008
Posted By gaurav1086
Strings are NOT pointers. Pointer airthmetic (buf...
Strings are NOT pointers. Pointer airthmetic (buf = buf + 5) can only be applied if buf is a pointer (char *buf) and not if it is a string (char buf [20] ) . If you want to do pointer airthmetic on a...
Forum: Programming 04-05-2011
2,462
Posted By gaurav1086
If you want the child process to execute first,...
If you want the child process to execute first, the parent process should wait() for the child before changing the permission like this ->



switch(pid = fork())
{
case -1: perror("fork...
Forum: Programming 04-05-2011
9,008
Posted By gaurav1086
should be if (count > len) Thanks, Gaurav. ...
should be if (count > len) Thanks,
Gaurav.

---------- Post updated at 03:08 PM ---------- Previous update was at 02:57 PM ----------
Another way ,



void * shiftbyn( char *str, size_t...
Forum: Programming 03-15-2011
9,066
Posted By gaurav1086
you are comparing a character(typically an...
you are comparing a character(typically an integer) with a string (char *) . This is illegal, you should better try



Note the difference b/w "r" and 'r'.

There are other problems yet with...
Forum: Programming 03-12-2011
1,848
Posted By gaurav1086
By rule , the declaration of the function should...
By rule , the declaration of the function should be present in that translation unit(file) where the function is called.
So take care to include the declaration of the function "go" in t.c or a.h...
Forum: Programming 03-10-2011
27,426
Posted By gaurav1086
you are free'ing buf (allocated by kmalloc)...
you are free'ing buf (allocated by kmalloc) conditionally. It can cause memory leak in kernel space.

Thanks,
Gaurav.
Forum: Programming 03-10-2011
11,342
Posted By gaurav1086
would be nice if you paste the result of the...
would be nice if you paste the result of the configure script. Also check the exit status and try to locate the "missing header" using a simple find if you can find it.
Forum: Programming 03-10-2011
3,254
Posted By gaurav1086
Hi ctote, if a ptr is NOT NULL, then it is...
Hi ctote,

if a ptr is NOT NULL, then it is true, (for ex. containing a junk values, aka bad pointer). if you did not define your ptr to NULL when you declare/free them, you should be careful...
6,473
Posted By gaurav1086
Hi, Why would you want to delve into depths...
Hi,

Why would you want to delve into depths if you have to remove all the dirs. ?

you can choose "-maxdepth" instead of "-mindepth"
Or
you can choose to do rm -rf instead.

If I got...
3,669
Posted By gaurav1086
Hello , use "egrep" instead of "grep" . You...
Hello ,

use "egrep" instead of "grep" . You are using ERE (extended regular expressions) which egrep supports .

Regards,
Gaurav.
8,584
Posted By gaurav1086
Hello, gaurav@localhost:~/unix$ cat...
Hello,



gaurav@localhost:~/unix$ cat test2.txt
=====================
NEXT HOST
=====================
AEADBAS001
access-list 1 permit xxxxxxxxxxxxxx
ip access-list extended...
8,023
Posted By gaurav1086
Try this awk '$(NF-1)=="1"' file ...
Try this


awk '$(NF-1)=="1"' file


Regards,
Gaurav.
Showing results 1 to 25 of 297

 
All times are GMT -4. The time now is 08:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy