The only safe way of doing this would be to run your program as root. Any program that needs to write to system directories should be run as root anyway. A normal user has no business accessing those directories.
If your really, really want to make your system insecure you can look up SUID. Although, as explained here, you will have trouble setting SUID for scripts.
I really do not recommend this though. Seriously, just run your program as root. On a debian derived system (or any other that has sudo configured) do:
$ sudo your_program_name
If sudo is not configured, do:
$ su $ your_program_name