I have one jar which i need to run on startup and no matter whatever user is logged in and that need to take that user name automatcally here this code can take user name
echo $(logname)
and this command i need to run on start up.
java -jar /home/(username)/VISDashboard2014/VISDashboard.jar
so now how can i take dynamically username in to this command.?
$HOME
or$USER
Environment Variables. In which$USER
provide<username>
and$HOME
provide/home/$USER
path. (You should replace(username)
with$(logname)
or$USER
)