By Robin Scher -
Hi Unix gurus,
I have a question about shell scripts. My daemon init script is being started by root at system boot time. I'd like the script to be able to access environment variables set in the default locations (e.g. /etc/profile). I get this automatically if I use the -i flag in the shebang at the top of the script:
#!/bin/sh -i
The script itself does some simple processing to validate paths and set its own custom variables, then starts a binary and terminates. The binary inherits the environment, which is the ultimate goal. However, I am concerned about having a script that is "interactive" not being used interactively, because of the subtle differences in how bash works in interactive mode.
Should I be worried about this? Testing shows that it works as expected on one user's system, but could it cause problems on different distributions of Linux or different versions?
I appreciate any feedback you may have. Thanks!
-robin
Robin Scher
robin@uberware.net
+1 (213) 448-0443
To unsubscribe from the list send a blank e-mail to mailto:studiosysadmins-discuss-request@studiosysadmins.com?subject=unsubscribe
↧