What environment variables available while starting the script using init.d boot process

Posted by raj_arni on Stack Overflow See other posts from Stack Overflow or by raj_arni
Published on 2010-04-08T09:37:46Z Indexed on 2010/04/15 4:53 UTC
Read the original article Hit count: 171

Filed under:
|
|
|

My problem is like this (OS is Sun Solaris):

1) At the boot time I want to start a process using a specific script. I am doing this by putting this script in /etc/init.d (and following other K and S rules)

2) The program which will be called by the script is located at $HOME/xxx/yyy location.

4) I am using 'su - {myuser} -c "{full path of the program}"' in order to execute the script as {myuser}

3) I dont want to hardcode the value of $HOME in the script but want to use the $HOME env variable only. How can I get this $HOME env variable in the shell script? Also what other variables will be available to me?

© Stack Overflow or respective owner

Related posts about unix

Related posts about shell