bash setenv command is not found











up vote
9
down vote

favorite












When I am using the following command



         setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH


error is



        bash setenv command is not found


When i find path of setenv by which command , then i found following path



 (/usr/kerberos/sbin:/usr/kerberos/bin:/home/ec2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/ec2/bin:/root/bin)









share|improve this question















migrated from serverfault.com Jul 31 '13 at 20:06


This question came from our site for system and network administrators.



















    up vote
    9
    down vote

    favorite












    When I am using the following command



             setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH


    error is



            bash setenv command is not found


    When i find path of setenv by which command , then i found following path



     (/usr/kerberos/sbin:/usr/kerberos/bin:/home/ec2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/ec2/bin:/root/bin)









    share|improve this question















    migrated from serverfault.com Jul 31 '13 at 20:06


    This question came from our site for system and network administrators.

















      up vote
      9
      down vote

      favorite









      up vote
      9
      down vote

      favorite











      When I am using the following command



               setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH


      error is



              bash setenv command is not found


      When i find path of setenv by which command , then i found following path



       (/usr/kerberos/sbin:/usr/kerberos/bin:/home/ec2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/ec2/bin:/root/bin)









      share|improve this question















      When I am using the following command



               setenv CLASSPATH /path/mysql-connector-java-ver-bin.jar:$CLASSPATH


      error is



              bash setenv command is not found


      When i find path of setenv by which command , then i found following path



       (/usr/kerberos/sbin:/usr/kerberos/bin:/home/ec2/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/ec2/bin:/root/bin)






      bash environment-variables






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 25 at 22:28









      Rui F Ribeiro

      38.3k1477127




      38.3k1477127










      asked Jul 31 '13 at 7:17







      Blue Green











      migrated from serverfault.com Jul 31 '13 at 20:06


      This question came from our site for system and network administrators.






      migrated from serverfault.com Jul 31 '13 at 20:06


      This question came from our site for system and network administrators.
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          13
          down vote













          setenv belongs to (t)csh, not to bash which is the default shell in CentOS. Use



          export CLASSPATH="/path/mysql-connector-java-ver-bin.jar:$CLASSPATH"


          instead.






          share|improve this answer




























            up vote
            2
            down vote













            Even better because more clean, use prefix notation (without set) on the command you want to invoke:



            CLASSPATH=/path/mysql-connector-java-ver-bin.jar:$CLASSPATH ANOTHER_VAR=bla ATHIRD_VAR=blu java -...


            Now the java process you invoke will be able to gather your temporary environment variable(s) CLASSPATH, ANOTHER_VAR and ATHIRD_VAR.



            If you used export, then the variables will also be set globally(?), at least on the script's environment. And, values of variables which already existed would be overwritten by the new values.



            Advantages of prefix notation:




            • previous values of a variable should stay unchanged, i.e. in the case the old values are being needed later on, then there would be no need to save the old values of the variables which already existed in order to restore them after the invocation

            • no need to unset your temporary variables for cleanup purposes after the invocation






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85099%2fbash-setenv-command-is-not-found%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown
























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              13
              down vote













              setenv belongs to (t)csh, not to bash which is the default shell in CentOS. Use



              export CLASSPATH="/path/mysql-connector-java-ver-bin.jar:$CLASSPATH"


              instead.






              share|improve this answer

























                up vote
                13
                down vote













                setenv belongs to (t)csh, not to bash which is the default shell in CentOS. Use



                export CLASSPATH="/path/mysql-connector-java-ver-bin.jar:$CLASSPATH"


                instead.






                share|improve this answer























                  up vote
                  13
                  down vote










                  up vote
                  13
                  down vote









                  setenv belongs to (t)csh, not to bash which is the default shell in CentOS. Use



                  export CLASSPATH="/path/mysql-connector-java-ver-bin.jar:$CLASSPATH"


                  instead.






                  share|improve this answer












                  setenv belongs to (t)csh, not to bash which is the default shell in CentOS. Use



                  export CLASSPATH="/path/mysql-connector-java-ver-bin.jar:$CLASSPATH"


                  instead.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 31 '13 at 7:23









                  Janne Pikkarainen

                  29514




                  29514
























                      up vote
                      2
                      down vote













                      Even better because more clean, use prefix notation (without set) on the command you want to invoke:



                      CLASSPATH=/path/mysql-connector-java-ver-bin.jar:$CLASSPATH ANOTHER_VAR=bla ATHIRD_VAR=blu java -...


                      Now the java process you invoke will be able to gather your temporary environment variable(s) CLASSPATH, ANOTHER_VAR and ATHIRD_VAR.



                      If you used export, then the variables will also be set globally(?), at least on the script's environment. And, values of variables which already existed would be overwritten by the new values.



                      Advantages of prefix notation:




                      • previous values of a variable should stay unchanged, i.e. in the case the old values are being needed later on, then there would be no need to save the old values of the variables which already existed in order to restore them after the invocation

                      • no need to unset your temporary variables for cleanup purposes after the invocation






                      share|improve this answer



























                        up vote
                        2
                        down vote













                        Even better because more clean, use prefix notation (without set) on the command you want to invoke:



                        CLASSPATH=/path/mysql-connector-java-ver-bin.jar:$CLASSPATH ANOTHER_VAR=bla ATHIRD_VAR=blu java -...


                        Now the java process you invoke will be able to gather your temporary environment variable(s) CLASSPATH, ANOTHER_VAR and ATHIRD_VAR.



                        If you used export, then the variables will also be set globally(?), at least on the script's environment. And, values of variables which already existed would be overwritten by the new values.



                        Advantages of prefix notation:




                        • previous values of a variable should stay unchanged, i.e. in the case the old values are being needed later on, then there would be no need to save the old values of the variables which already existed in order to restore them after the invocation

                        • no need to unset your temporary variables for cleanup purposes after the invocation






                        share|improve this answer

























                          up vote
                          2
                          down vote










                          up vote
                          2
                          down vote









                          Even better because more clean, use prefix notation (without set) on the command you want to invoke:



                          CLASSPATH=/path/mysql-connector-java-ver-bin.jar:$CLASSPATH ANOTHER_VAR=bla ATHIRD_VAR=blu java -...


                          Now the java process you invoke will be able to gather your temporary environment variable(s) CLASSPATH, ANOTHER_VAR and ATHIRD_VAR.



                          If you used export, then the variables will also be set globally(?), at least on the script's environment. And, values of variables which already existed would be overwritten by the new values.



                          Advantages of prefix notation:




                          • previous values of a variable should stay unchanged, i.e. in the case the old values are being needed later on, then there would be no need to save the old values of the variables which already existed in order to restore them after the invocation

                          • no need to unset your temporary variables for cleanup purposes after the invocation






                          share|improve this answer














                          Even better because more clean, use prefix notation (without set) on the command you want to invoke:



                          CLASSPATH=/path/mysql-connector-java-ver-bin.jar:$CLASSPATH ANOTHER_VAR=bla ATHIRD_VAR=blu java -...


                          Now the java process you invoke will be able to gather your temporary environment variable(s) CLASSPATH, ANOTHER_VAR and ATHIRD_VAR.



                          If you used export, then the variables will also be set globally(?), at least on the script's environment. And, values of variables which already existed would be overwritten by the new values.



                          Advantages of prefix notation:




                          • previous values of a variable should stay unchanged, i.e. in the case the old values are being needed later on, then there would be no need to save the old values of the variables which already existed in order to restore them after the invocation

                          • no need to unset your temporary variables for cleanup purposes after the invocation







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Mar 8 '16 at 15:02

























                          answered Mar 8 '16 at 14:45









                          user160163

                          212




                          212






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f85099%2fbash-setenv-command-is-not-found%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              List directoties down one level, excluding some named directories and files

                              list processes belonging to a network namespace

                              list systemd RuntimeDirectory mounts