Why programs run at boot/shutdown are written in bash script? If a compiled language (or a faster interpreted language, like Python) was used, then its running time would be shorter.
Why is bash used in boot scripts?
boot;init script
It is largely historic, partly a matter of control from a system administration aspect, partly a portability issue, partly a debugging issue.Back in the day, there was no autoconf, dpkg, rpm.  You downloaded the software, sometimes from UUCP, compiled the product and determined - with your own conventions - where to install the product.  Hooking the product up to the boot/shutdown system was thought to be a duty of the system administrator.  The sysadmin would write the rc script and place it in the appropriate place for that system (/etc/inittab, /etc/rcN.d/, /etc/rc.local, /etc/inetd.conf).  With fewer of the non-linux systems in the forefront, the advent of rpm and dpkg makes some of these local choices less important.Systems administrators also like to have some measure of control over their systems, and the easiest write, debug and modify later are shell scripts, not C programs.As I alluded to earlier, different UNIX OSs had different ways to boot.  Writing a short shell script for your own system was much easier than the developer writing for every possible flavor of UNIX that was coming up (again, this was before even autoconf): SysV, Ultrix, Irix, HP-UX, SunOS, Solaris, NextStep, NonStop, etc.  For the most part, they fell into two or three mechanisms, but each had their own twist.Boot systems can get complicated easily.  It's good to have a shell script where you can print debugging information, change the flow, handle interactions that the program authors didn't anticipate.  If this was a compiled program, it would make finding such errors much more difficult.Modern systems have newer mechanisms, but most will still call shell scripts, largely for the reasons above.