ssh redirect output of Unix pwd command to a file il the local server

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Script abcd.sh:
####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
exportÃÂ pathofremote
#####
Running abcd.sh:
-bash:./abcd.sh
pathofremote: command not found
remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied
While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote
Also I am not able to save the output of the file to another file in the localserver.
ssh
add a comment |Â
up vote
0
down vote
favorite
Script abcd.sh:
####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
exportÃÂ pathofremote
#####
Running abcd.sh:
-bash:./abcd.sh
pathofremote: command not found
remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied
While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote
Also I am not able to save the output of the file to another file in the localserver.
ssh
5
At a minimum, remove the space betweenpathofremoteand=
â user4556274
Oct 16 '17 at 14:31
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Script abcd.sh:
####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
exportÃÂ pathofremote
#####
Running abcd.sh:
-bash:./abcd.sh
pathofremote: command not found
remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied
While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote
Also I am not able to save the output of the file to another file in the localserver.
ssh
Script abcd.sh:
####
ssh $user_name@$ftp_site pwd > /export/home/appwxsms/remotepathfile.lst;
pathofremote =`sed -n '1p' $HOME/remotepathfile.lst`
exportÃÂ pathofremote
#####
Running abcd.sh:
-bash:./abcd.sh
pathofremote: command not found
remotepathfile.lst > output.txt
-bash: /export/home/appwxsms/remotepathfile1.lst: Permission denied
While running the abcd.sh script I am not able to sed the output of the file generated in local path remotepathfile.lst to the variable pathofremote
Also I am not able to save the output of the file to another file in the localserver.
ssh
edited Oct 16 '17 at 14:31
Stephen Rauch
3,248101227
3,248101227
asked Oct 16 '17 at 14:22
user254860
1
1
5
At a minimum, remove the space betweenpathofremoteand=
â user4556274
Oct 16 '17 at 14:31
add a comment |Â
5
At a minimum, remove the space betweenpathofremoteand=
â user4556274
Oct 16 '17 at 14:31
5
5
At a minimum, remove the space between
pathofremote and =â user4556274
Oct 16 '17 at 14:31
At a minimum, remove the space between
pathofremote and =â user4556274
Oct 16 '17 at 14:31
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.
foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.
foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'
add a comment |Â
up vote
2
down vote
Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.
foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'
add a comment |Â
up vote
2
down vote
up vote
2
down vote
Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.
foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'
Notwithstanding the syntactical error in your variable assignment, the file will be populated as you wish it to be.
foo =bar # This will attempt to run the command 'foo' with the parameter '=bar'
foo=bar # This will set the variable 'foo' equal to 'bar'
foo="$(bar)" # This will set the variable 'foo' to the output of the execution of 'bar'
answered Oct 16 '17 at 15:54
DopeGhoti
40.7k54979
40.7k54979
add a comment |Â
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%2f398430%2fssh-redirect-output-of-unix-pwd-command-to-a-file-il-the-local-server%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
5
At a minimum, remove the space between
pathofremoteand=â user4556274
Oct 16 '17 at 14:31