pass protocols to command from file
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Need one more help please..
Manual run of following command works fine
/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt)
but shell fails
can't read "(< /pass.txt)": no such variable
!/usr/bin/expect
spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt"
expect "password"
send "N0r"
interact
expect eof.
bash shell-script ssh command-line openssh
add a comment |Â
up vote
1
down vote
favorite
Need one more help please..
Manual run of following command works fine
/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt)
but shell fails
can't read "(< /pass.txt)": no such variable
!/usr/bin/expect
spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt"
expect "password"
send "N0r"
interact
expect eof.
bash shell-script ssh command-line openssh
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Need one more help please..
Manual run of following command works fine
/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt)
but shell fails
can't read "(< /pass.txt)": no such variable
!/usr/bin/expect
spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt"
expect "password"
send "N0r"
interact
expect eof.
bash shell-script ssh command-line openssh
Need one more help please..
Manual run of following command works fine
/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt)
but shell fails
can't read "(< /pass.txt)": no such variable
!/usr/bin/expect
spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt"
expect "password"
send "N0r"
interact
expect eof.
bash shell-script ssh command-line openssh
edited Dec 14 '17 at 14:18
Archemar
19k93366
19k93366
asked Dec 13 '17 at 14:54
SHaFqaT M
62
62
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48
add a comment |Â
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
Try
command $(< abc.txt)
where
$(< )
construct will read file, strip end of line and replace in command line
More information in Bash's manual, chapter Command Substitution:
Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any
trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution$(cat file)
can be replaced by the equivalent but faster$(< file)
.
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Try
command $(< abc.txt)
where
$(< )
construct will read file, strip end of line and replace in command line
More information in Bash's manual, chapter Command Substitution:
Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any
trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution$(cat file)
can be replaced by the equivalent but faster$(< file)
.
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
add a comment |Â
up vote
1
down vote
Try
command $(< abc.txt)
where
$(< )
construct will read file, strip end of line and replace in command line
More information in Bash's manual, chapter Command Substitution:
Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any
trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution$(cat file)
can be replaced by the equivalent but faster$(< file)
.
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Try
command $(< abc.txt)
where
$(< )
construct will read file, strip end of line and replace in command line
More information in Bash's manual, chapter Command Substitution:
Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any
trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution$(cat file)
can be replaced by the equivalent but faster$(< file)
.
Try
command $(< abc.txt)
where
$(< )
construct will read file, strip end of line and replace in command line
More information in Bash's manual, chapter Command Substitution:
Bash performs the expansion by executing command and replacing the command substitution with the standard output of the command, with any
trailing newlines deleted. Embedded newlines are not deleted, but they may be removed during word splitting. The command substitution$(cat file)
can be replaced by the equivalent but faster$(< file)
.
edited Dec 13 '17 at 16:38
ilkkachu
49.9k674137
49.9k674137
answered Dec 13 '17 at 15:07
Archemar
19k93366
19k93366
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
add a comment |Â
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
worked like a charm :-), Thanks a TON.
â SHaFqaT M
Dec 13 '17 at 18:22
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
Need one more help please.. Manual run of following command works fine /jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt) but shell fails can't read "(< /pass.txt)": no such variable #!/usr/bin/expect spawn ssh gq1@a732.co.com "/jrr/bin/java -Xms14M -Xm14M -Dhttps.protocols=Tv1.2 -Dk.ts.client.protocols=TLSv.2 -jar /gq1/ust/classes/S.jar $(< /pass.txt);cd /gucq1/gcust;mail -s 'Hello' sam@gm.com < logs.txt" expect "password" send "N0r" interact expect eof.
â SHaFqaT M
Dec 14 '17 at 8:52
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f410659%2fpass-protocols-to-command-from-file%23new-answer', 'question_page');
);
Post as a guest
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
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
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
please do not change question, as is my answer in completly useless. you asked a question about bash, then about expect, those ar two differents topic. would you kindly rollback to version 5 and ask a new question ?
â Archemar
Dec 14 '17 at 14:21
My apologies... I will change it to previous version.
â SHaFqaT M
Dec 14 '17 at 17:48