How to set multiple env variables? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
-3
down vote

favorite












I have to set 10 env variables (setenv). I saved all these env variable in a filename.env. Is there a way to set all the variable inside the file with single command ?



I tried with "source filename.env", variables are getting set but many other things are also happening. Doubt what I did is wrong. Please help.



Edit:
content of filename.env:



setenv variable1 value1
setenv variable2 value2
.
.
setenv variable10 value10






share|improve this question














closed as unclear what you're asking by Jeff Schaller, jimmij, Fox, mdpc, Rui F Ribeiro Jan 16 at 1:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4




    What’s in the file and what, exactly, are the “many other things?”
    – Jeff Schaller
    Jan 15 at 13:22






  • 4




    Why not add the content of your .env file to your question?
    – Weijun Zhou
    Jan 15 at 13:26






  • 3




    What shell are you using? csh?
    – ilkkachu
    Jan 15 at 13:32










  • using cshc @ilkkachu
    – tollin jose
    Jan 16 at 12:07














up vote
-3
down vote

favorite












I have to set 10 env variables (setenv). I saved all these env variable in a filename.env. Is there a way to set all the variable inside the file with single command ?



I tried with "source filename.env", variables are getting set but many other things are also happening. Doubt what I did is wrong. Please help.



Edit:
content of filename.env:



setenv variable1 value1
setenv variable2 value2
.
.
setenv variable10 value10






share|improve this question














closed as unclear what you're asking by Jeff Schaller, jimmij, Fox, mdpc, Rui F Ribeiro Jan 16 at 1:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4




    What’s in the file and what, exactly, are the “many other things?”
    – Jeff Schaller
    Jan 15 at 13:22






  • 4




    Why not add the content of your .env file to your question?
    – Weijun Zhou
    Jan 15 at 13:26






  • 3




    What shell are you using? csh?
    – ilkkachu
    Jan 15 at 13:32










  • using cshc @ilkkachu
    – tollin jose
    Jan 16 at 12:07












up vote
-3
down vote

favorite









up vote
-3
down vote

favorite











I have to set 10 env variables (setenv). I saved all these env variable in a filename.env. Is there a way to set all the variable inside the file with single command ?



I tried with "source filename.env", variables are getting set but many other things are also happening. Doubt what I did is wrong. Please help.



Edit:
content of filename.env:



setenv variable1 value1
setenv variable2 value2
.
.
setenv variable10 value10






share|improve this question














I have to set 10 env variables (setenv). I saved all these env variable in a filename.env. Is there a way to set all the variable inside the file with single command ?



I tried with "source filename.env", variables are getting set but many other things are also happening. Doubt what I did is wrong. Please help.



Edit:
content of filename.env:



setenv variable1 value1
setenv variable2 value2
.
.
setenv variable10 value10








share|improve this question













share|improve this question




share|improve this question








edited Jan 16 at 12:18









peterh

3,93092755




3,93092755










asked Jan 15 at 13:15









tollin jose

984




984




closed as unclear what you're asking by Jeff Schaller, jimmij, Fox, mdpc, Rui F Ribeiro Jan 16 at 1:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Jeff Schaller, jimmij, Fox, mdpc, Rui F Ribeiro Jan 16 at 1:00


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 4




    What’s in the file and what, exactly, are the “many other things?”
    – Jeff Schaller
    Jan 15 at 13:22






  • 4




    Why not add the content of your .env file to your question?
    – Weijun Zhou
    Jan 15 at 13:26






  • 3




    What shell are you using? csh?
    – ilkkachu
    Jan 15 at 13:32










  • using cshc @ilkkachu
    – tollin jose
    Jan 16 at 12:07












  • 4




    What’s in the file and what, exactly, are the “many other things?”
    – Jeff Schaller
    Jan 15 at 13:22






  • 4




    Why not add the content of your .env file to your question?
    – Weijun Zhou
    Jan 15 at 13:26






  • 3




    What shell are you using? csh?
    – ilkkachu
    Jan 15 at 13:32










  • using cshc @ilkkachu
    – tollin jose
    Jan 16 at 12:07







4




4




What’s in the file and what, exactly, are the “many other things?”
– Jeff Schaller
Jan 15 at 13:22




What’s in the file and what, exactly, are the “many other things?”
– Jeff Schaller
Jan 15 at 13:22




4




4




Why not add the content of your .env file to your question?
– Weijun Zhou
Jan 15 at 13:26




Why not add the content of your .env file to your question?
– Weijun Zhou
Jan 15 at 13:26




3




3




What shell are you using? csh?
– ilkkachu
Jan 15 at 13:32




What shell are you using? csh?
– ilkkachu
Jan 15 at 13:32












using cshc @ilkkachu
– tollin jose
Jan 16 at 12:07




using cshc @ilkkachu
– tollin jose
Jan 16 at 12:07










1 Answer
1






active

oldest

votes

















up vote
1
down vote













in bash:



With the following file ~/variables.rc:



export test1="test1"
export test2="test2"
export test3="test3"
export test4="test4"
export test5="test5"


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test3



in csh:



With the following file ~/variables.rc:



setenv test1 test10
setenv test2 test20
setenv test3 test30
setenv test4 test40
setenv test5 test50


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test30





share|improve this answer






















  • if "setenv" instead of "export" same working ?
    – tollin jose
    Jan 16 at 10:00










  • It depends on your shell: unix.stackexchange.com/questions/368944/…
    – Kevin Lemaire
    Jan 16 at 10:15










  • What shell are you using?
    – Kevin Lemaire
    Jan 16 at 10:15






  • 1




    I am using cshc @kevin
    – tollin jose
    Jan 16 at 12:07

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













in bash:



With the following file ~/variables.rc:



export test1="test1"
export test2="test2"
export test3="test3"
export test4="test4"
export test5="test5"


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test3



in csh:



With the following file ~/variables.rc:



setenv test1 test10
setenv test2 test20
setenv test3 test30
setenv test4 test40
setenv test5 test50


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test30





share|improve this answer






















  • if "setenv" instead of "export" same working ?
    – tollin jose
    Jan 16 at 10:00










  • It depends on your shell: unix.stackexchange.com/questions/368944/…
    – Kevin Lemaire
    Jan 16 at 10:15










  • What shell are you using?
    – Kevin Lemaire
    Jan 16 at 10:15






  • 1




    I am using cshc @kevin
    – tollin jose
    Jan 16 at 12:07














up vote
1
down vote













in bash:



With the following file ~/variables.rc:



export test1="test1"
export test2="test2"
export test3="test3"
export test4="test4"
export test5="test5"


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test3



in csh:



With the following file ~/variables.rc:



setenv test1 test10
setenv test2 test20
setenv test3 test30
setenv test4 test40
setenv test5 test50


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test30





share|improve this answer






















  • if "setenv" instead of "export" same working ?
    – tollin jose
    Jan 16 at 10:00










  • It depends on your shell: unix.stackexchange.com/questions/368944/…
    – Kevin Lemaire
    Jan 16 at 10:15










  • What shell are you using?
    – Kevin Lemaire
    Jan 16 at 10:15






  • 1




    I am using cshc @kevin
    – tollin jose
    Jan 16 at 12:07












up vote
1
down vote










up vote
1
down vote









in bash:



With the following file ~/variables.rc:



export test1="test1"
export test2="test2"
export test3="test3"
export test4="test4"
export test5="test5"


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test3



in csh:



With the following file ~/variables.rc:



setenv test1 test10
setenv test2 test20
setenv test3 test30
setenv test4 test40
setenv test5 test50


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test30





share|improve this answer














in bash:



With the following file ~/variables.rc:



export test1="test1"
export test2="test2"
export test3="test3"
export test4="test4"
export test5="test5"


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test3



in csh:



With the following file ~/variables.rc:



setenv test1 test10
setenv test2 test20
setenv test3 test30
setenv test4 test40
setenv test5 test50


You can source the file. Those sourced variables are then known in your terminal session:



[ws] user ~ >source variables.rc 
[ws] user ~ >echo $test3
test30






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 16 at 13:36

























answered Jan 15 at 16:23









Kevin Lemaire

1,037421




1,037421











  • if "setenv" instead of "export" same working ?
    – tollin jose
    Jan 16 at 10:00










  • It depends on your shell: unix.stackexchange.com/questions/368944/…
    – Kevin Lemaire
    Jan 16 at 10:15










  • What shell are you using?
    – Kevin Lemaire
    Jan 16 at 10:15






  • 1




    I am using cshc @kevin
    – tollin jose
    Jan 16 at 12:07
















  • if "setenv" instead of "export" same working ?
    – tollin jose
    Jan 16 at 10:00










  • It depends on your shell: unix.stackexchange.com/questions/368944/…
    – Kevin Lemaire
    Jan 16 at 10:15










  • What shell are you using?
    – Kevin Lemaire
    Jan 16 at 10:15






  • 1




    I am using cshc @kevin
    – tollin jose
    Jan 16 at 12:07















if "setenv" instead of "export" same working ?
– tollin jose
Jan 16 at 10:00




if "setenv" instead of "export" same working ?
– tollin jose
Jan 16 at 10:00












It depends on your shell: unix.stackexchange.com/questions/368944/…
– Kevin Lemaire
Jan 16 at 10:15




It depends on your shell: unix.stackexchange.com/questions/368944/…
– Kevin Lemaire
Jan 16 at 10:15












What shell are you using?
– Kevin Lemaire
Jan 16 at 10:15




What shell are you using?
– Kevin Lemaire
Jan 16 at 10:15




1




1




I am using cshc @kevin
– tollin jose
Jan 16 at 12:07




I am using cshc @kevin
– tollin jose
Jan 16 at 12:07


Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)