Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> An application should never rely on a shell script. If you have to execute another program, use the syscalls (fork and exec on posix).

Could you explain why? I'm very happy with programs calling shell commands/scripts. You execute another program the same way whether interactively from a shell, or by calling system() from another program. The simplicity and universality of the call syntax is an advantage.



Security. system() is one of the most common targets for hacking (getting a shell by manipulating the string passed to system() by various means). Calling programs from the kernel directly is a lot more well-behaved. You're limited to only executing one program.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: