LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-26-2022, 04:05 AM   #1
M0M0
Member
 
Registered: Sep 2020
Location: Germany
Distribution: Slackware
Posts: 230

Rep: Reputation: 20
Export variables during boot


I have a script from a commercial software that sets the according variables to run the software. If I source that script from an interactive shell everything is fine. However, I would like to source that script during boot time. So, I added

Code:
if [ -f /that/script ]; then
  . /that/script
fi
to /etc/rc.d/rc.local. If I boot the machine, I can see that the script gets run and all the variables get set. However, in the interactive shell running in the tty those variables are not set anymore. I assume that the interactive shells are not a child of the shell that was run by init so it makes sense thate the variables are gone.

So, how can I run a script from rc.local and keep the variables it has set?
 
Old 06-26-2022, 04:12 AM   #2
pghvlaans
Member
 
Registered: Jan 2021
Distribution: Slackware64 {15.0,-current}, FreeBSD, stuff on QEMU
Posts: 458

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
Maybe put the script in /etc/profile.d so that it also gets sourced at every login.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] fstab or export options needed to write to an nfs mounted ntfs export chief427 Linux - General 2 07-21-2011 07:07 AM
why should we export COMPTOP and what does !export do ? shaiva Linux - Newbie 5 11-03-2009 03:44 PM
export environment variables at boot-up shan23 Linux - Newbie 2 03-02-2009 07:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration