If you use a shell script you can use those unix shell methods from your Original Post, yeah.
Also, I woke up sweating in the middle of the night because I suddenly realized I did this
That should be &, not &&. && will wait for the process to sucessfully complete. Maybe that is a good idea. Anyway, & will fork and move on immediately (I hate the idea of someone being frustrated by my mistake).
You can actually use $1 (first parameter) here too, so if the script started:
Code:
#!/bin/bash
wget -r -np -k -p $1 -o LOG &
you could launch it "myscript http://cboard.cprogramming.com".
Also, that thing about C & the line length: no, you do not need to know it. You just need to make sure the buffer length and the fgets parameter are the same. fgets() stops at a new line, but if the line is too long, it will stop before that, and pick up where it left off on the next pass. So it doesn't matter how long the lines are. Since you are using *nix, it would also be fine to use fread(), which does not stop at a new line and hence would be more efficient since it will always completely fill the buffer.