You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "jieguangzhou (via GitHub)" <gi...@apache.org> on 2023/03/15 14:06:05 UTC
[GitHub] [mina-sshd] jieguangzhou opened a new issue, #333: The command "source ~/.bashrc" is invalid.
jieguangzhou opened a new issue, #333:
URL: https://github.com/apache/mina-sshd/issues/333
### Version
2.9.0
### Bug description
When I execute the command "source ~.bashrc", it doesn't take effect. As shown below, there is an environment variable "ABC" in my bashrc, but I can't output it.k
The code is as follows:
```java
ClientSession session = client.connect(user, host, port).verify().getSession();
boolean result = session.auth().verify().isSuccess();
if (result) {
System.out.println("Success");
} else {
System.out.println("Failed");
}
System.out.println(result);
String command = "cat ~/.bashrc && source ~/.bashrc && echo $ABC && echo END";
String cmd = String.format(command);
System.out.println(cmd);
String executeResult = session.executeRemoteCommand(cmd);
System.out.println(executeResult);
client.stop();
```
### Actual behavior
The outputs is as follows:
```
.... some other contents.....
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export ABC=abc
END
```
### Expected behavior
I think the output should be
```
.... some other contents.....
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export ABC=abc
abc
END
```
### Relevant log output
_No response_
### Other information
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
[GitHub] [mina-sshd] jieguangzhou commented on issue #333: [BUG]The command "source ~/.bashrc" is invalid.
Posted by "jieguangzhou (via GitHub)" <gi...@apache.org>.
jieguangzhou commented on issue #333:
URL: https://github.com/apache/mina-sshd/issues/333#issuecomment-1470079206
I'm not sure if I'm using it incorrectly, but what I actually expect is that it can read bashrc and other files by default, just like the behavior of directly executing them when I log in. Can anyone help me with this? Thank you very much.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
[GitHub] [mina-sshd] jieguangzhou commented on issue #333: [BUG]The command "source ~/.bashrc" is invalid.
Posted by "jieguangzhou (via GitHub)" <gi...@apache.org>.
jieguangzhou commented on issue #333:
URL: https://github.com/apache/mina-sshd/issues/333#issuecomment-1484371478
Thanks
> Apparently the command gets passed to the server all right. So you'd have to check what the server does. If that is not an Apache MINA sshd server, then it's not an Apache MINA sshd problem.
Thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
[GitHub] [mina-sshd] jieguangzhou closed issue #333: [BUG]The command "source ~/.bashrc" is invalid.
Posted by "jieguangzhou (via GitHub)" <gi...@apache.org>.
jieguangzhou closed issue #333: [BUG]The command "source ~/.bashrc" is invalid.
URL: https://github.com/apache/mina-sshd/issues/333
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org
[GitHub] [mina-sshd] tomaswolf commented on issue #333: [BUG]The command "source ~/.bashrc" is invalid.
Posted by "tomaswolf (via GitHub)" <gi...@apache.org>.
tomaswolf commented on issue #333:
URL: https://github.com/apache/mina-sshd/issues/333#issuecomment-1483873173
Apparently the command gets passed to the server all right. So you'd have to check what the server does. If that is not an Apache MINA sshd server, then it's not an Apache MINA sshd problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org