Re: [algogeeks] Re: linux program in c

2011-10-02 Thread rahul vatsa
wen u do frok in ur code, the pr gets duplicated. so that line wher fork is invoked is also in both the processes. nw in parent code it will return pid of child & in child code it will return 0. getpid will always return the pid of the pr. so obviously it will return pid of the child in the child

Re: [algogeeks] Re: linux program in c

2011-10-02 Thread rahul sharma
pid=0 for child then getpid in child???gives child process id???plz xplain On Sun, Oct 2, 2011 at 1:32 PM, rahul vatsa wrote: > child contains full code, bt it will start execution of the next line after > the fork. > return value of fork is 0 for the child, bt pid of the child in the parent > p

Re: [algogeeks] Re: linux program in c

2011-10-02 Thread rahul vatsa
child contains full code, bt it will start execution of the next line after the fork. return value of fork is 0 for the child, bt pid of the child in the parent process. On Sun, Oct 2, 2011 at 3:50 AM, rahul sharma wrote: > plz tell me hw does fork wokrs???child contain full code ore the > statem

Re: [algogeeks] Re: linux program in c

2011-10-02 Thread sumit kumar pathak
*http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html* * * *hope this is helpful *regards - Sumit Kumar Pathak (Sumit/ Pathak/ SKP ...) *Smile is only good contagious thing.* *Spread it*! On Sun, Oct 2, 2011 at 1:20 PM, rahul sharma wrote: > plz tell me hw does fork wokrs???child contain

[algogeeks] Re: linux program in c

2011-10-02 Thread rahul sharma
plz tell me hw does fork wokrs???child contain full code ore the statements after forkhw pid is 0 with pi=fork(); i cant get these..plz tell asap...thnx On Oct 2, 12:49 pm, rahul sharma wrote: > main() > { > int pid; > pid=fork(); > if(pid==0) > { > print child; > print("...",getpid());} > >

[algogeeks] Re: Linux

2010-09-22 Thread Dave
@Davesh: foo is the file name. Isn't foo frequently used as a file name in Unix/Linix? Dave On Sep 22, 8:25 am, Divesh Dixit wrote: > @Dave >   ya i got it heat -10 output through pipe tail -6.  but can u > explain "foo"?? > > On Sep 21, 10:25 pm, Dave wrote: > > > > > If you can use both,

[algogeeks] Re: Linux

2010-09-22 Thread Divesh Dixit
@Dave ya i got it heat -10 output through pipe tail -6. but can u explain "foo"?? On Sep 21, 10:25 pm, Dave wrote: > If you can use both, it would be > > head -10 foo | tail -6 > > It doesn't do the right thing if the file has fewer than 10 lines, > though. > > Dave > > On Sep 21, 4:04 pm

[algogeeks] Re: Linux

2010-09-21 Thread Dave
If you can use both, it would be head -10 foo | tail -6 It doesn't do the right thing if the file has fewer than 10 lines, though. Dave On Sep 21, 4:04 pm, Divesh Dixit wrote: > How to get  line no. 5 to line no. 10  only from a file.. using tail > or head command.? -- You received this mess