jsch


How to pass a variable through channel in Jsch?


Here is my code partially:
Channel channel_1 = session.openChannel("exec");
int t=5;
((ChannelExec)channel_1).setCommand("echo value : $(t)>> test.sh");
channel_1.connect();channel_1.disconnect();
I want the script "test.sh" in my remote machine written as "value : 5"
But the output I get is "value : " in the script.
String command = "echo value : " + t + " >> test.sh";
((ChannelExec)channel_1).setCommand(command);

Related Links

JSch read local log file
JSCH setCommand is not working
com.jcraft.jsch.JSchException: SSH_MSG_DISCONNECT: 11 No appropriate prime between 1024 and 1024 is available. en
I'm trying to use Jsch to establish an SSH connection in Java.I got the Exception com.jcraft.jsch.jschexception unknownhostkey
com.jcraft.jsch.JSchException: failed to send sftp request
JSch for pbrun not working
JSCH read from input stream hangs from time to time
Hundreds of Apache SSHD clients leave hundreds of OpenSSH daemon processes running
Jsch - ssh connection through ssh tunnel
Changing password using Jsch and ChannelExec
how to delete local file using jsch after file is sent to remote SFTP server directory
com.jcraft.jsch.JSchException: Auth fail error
Creating a new file in SSH enabled system using JSCH
How to interact with the script after its execution using Jsch
java jsch -executing multiple unix commands
How to get one stream from error stream and input stream when calling a script using JSCH

Categories

HOME
magnific-popup
mediawiki
read-eval-print-loop
ezpublish
pheatmap
gitpitch
row
commonmark
windows-phone-7
fortumo
pc
fatal-error
alpine
textfield
autocad-plugin
mmap
tibco-mdm
tdd
sparse-matrix
preg-match
react-chartjs
yadcf
airconsole
column-family
google-api-nodejs-client
swisscomdev
objectlistview
theano.scan
ssjs
firebase-admin
flashair
sencha-touch-2.3
azure-application-gateway
jquery-nestable
typescript1.8
tropo
qtwebview
zendesk-app
heidisql
mongocsharpdriver
gridview-sorting
jwplayer7
angstrom-linux
disque
ready-api
testng-dataprovider
fadeout
apachebench
bluegiga
freedesktop.org
hsv
tmuxinator
iis-arr
security-testing
muse
census
bridge.net
truevault
c++03
npapi
html-helper
code-access-security
typeof
dml
mysql-error-1062
intentservice
mysqltuner
apc
odata4j
ruby-datamapper
tws
funscript
nsmanagedobject
eclipse-templates
oncheckedchanged
jmock
meego
uimenucontroller
spec#
scripting-languages

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App