How can I keep variables used in a script in a secondary file? For example, use store variables in myscript.env for use in a script myscript.sh.
So whenever I need to change variables I can edit myscript.env instead of myscript.sh.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply include the file using the “dot operator”.
assuming these two files are in the same directory, the following will work:
t.sh:
t.env:
When run: