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)
bash environment-variables
migrated from serverfault.com Jul 31 '13 at 20:06
This question came from our site for system and network administrators.
add a comment |
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)
bash environment-variables
migrated from serverfault.com Jul 31 '13 at 20:06
This question came from our site for system and network administrators.
add a comment |
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)
bash environment-variables
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
bash environment-variables
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.
add a comment |
add a comment |
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.
add a comment |
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
unsetyour temporary variables for cleanup purposes after the invocation
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jul 31 '13 at 7:23
Janne Pikkarainen
29514
29514
add a comment |
add a comment |
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
unsetyour temporary variables for cleanup purposes after the invocation
add a comment |
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
unsetyour temporary variables for cleanup purposes after the invocation
add a comment |
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
unsetyour temporary variables for cleanup purposes after the invocation
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
unsetyour temporary variables for cleanup purposes after the invocation
edited Mar 8 '16 at 15:02
answered Mar 8 '16 at 14:45
user160163
212
212
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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