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 - 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
SFTP using jschexception verify false sometimes fails
how to increase the jsch buffer size?
The cipher 'aes256-cbc' is required, but it is not available
How to pause/resume procedure while/after upload file by ChannelSftp
jsch + running multiple command in shell after SU and then close channal
NGit/Nsch Generating SSH Keypair (c# Jgit)
Extract userInfo from JSCH stream
Running a Shell Script using java ( process Builder ) with a specific unix user

Categories

HOME
java
twitter
bluetooth
cloud
listview
homebrew
elm
amortized-analysis
malloc
v8
acquia
flyway4
django-imagekit
uber-api
maude-system
tomcat6
nano-server
mapserver
apache-cayenne
fallback
netflix
seaborn
tostring
jqwidget
samoa
firefox-webextensions
nodatime
one-hot-encoding
csrf-protection
realex-payments-api
telerik-reporting
language-agnostic
claims-based-identity
trading
android-widget
kannel
fgetcsv
nhapi
elasticsearch-ruby
opentype
tinymce-4
key-value-observing
framemaker
form-data
git-merge
xenforo
reportbuilder
squib
ws-security
ncalc
heightmap
segment
convertapi
strptime
sage-one
mu
carrot
tactic
magma
libusb-win32
typed-lambda-calculus
hittest
eventkit
messenger
xcb
color-picker
etsy
websitepanel
flash-cs5
hill-climbing
make-install
dlna
bluemix-app-scan
ios4
iad
metaclass
comobject
coveralls
muse
map-projections
unity3d-gui
cdt
document-classification
has-many-through
htmlcleaner
ms-project-server-2010
tidy
web2py-modules
mylyn
django-nonrel
random-seed
android-hardware
simba
funscript
javaspaces
parametric-equations
hgsubversion
custom-backend
appender
yslow
blitz++
xsdobjectgen
perfect-hash
substrings
webkit.net
temporal-database
mediarss
grid-system
dbisam

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App