Remote ssh script execution with EOI or EOSSH adding dots in front of commands

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












0















Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?



ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt

sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT

EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit

EOI


Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:



Command '.sudo' not found, did you mean:

command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap

Try: sudo apt install <deb name>


Someone shared a solution before but later removed it, I think that would work for me. :)



Why is it adding "." in front of all commands?










share|improve this question
























  • Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

    – Haxiel
    Mar 1 at 10:58











  • Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

    – Rakib Fiha
    Mar 1 at 15:38












  • Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

    – Haxiel
    Mar 1 at 16:15















0















Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?



ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt

sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT

EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit

EOI


Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:



Command '.sudo' not found, did you mean:

command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap

Try: sudo apt install <deb name>


Someone shared a solution before but later removed it, I think that would work for me. :)



Why is it adding "." in front of all commands?










share|improve this question
























  • Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

    – Haxiel
    Mar 1 at 10:58











  • Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

    – Rakib Fiha
    Mar 1 at 15:38












  • Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

    – Haxiel
    Mar 1 at 16:15













0












0








0








Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?



ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt

sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT

EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit

EOI


Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:



Command '.sudo' not found, did you mean:

command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap

Try: sudo apt install <deb name>


Someone shared a solution before but later removed it, I think that would work for me. :)



Why is it adding "." in front of all commands?










share|improve this question
















Here the first block was running, second block was not. And the problem was EOI considers spaces as dots, I think. But, it does not consider tab as dot. Making no indentation worked for me. But is there any way to specify not to consider tabs or spaces as dots?



ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo rm -rf letsencrypt.tar.gz
sudo rm -rf /etc/letsencrypt
sudo rm -rf /usr/local/share/ca-certificates/chain.crt

sed -e 1b -e '$!d' $remote_home_dir/.bashrc
sudo add-apt-repository ppa:certbot/certbot -y
sudo apt-get install certbot -y &
exit
trap exit INT

EOI
###############
ssh -tt -vvv -i $pathToPem -o StrictHostKeyChecking=no $sshUsernameIp << EOI

sudo certbot certonly -n --agree-tos --register-unsafely-without-email --standalone -d $FQDN
sudo chown -R root:sudo /etc/letsencrypt/
sudo chmod -R 750 /etc/letsencrypt/
sudo chmod -R 644 /usr/local/share/
sudo cp /etc/letsencrypt/live/$FQDN/chain.pem /usr/local/share/ca-certificates/chain.crt
sudo update-ca-certificates
sudo tar -czvf letsencrypt.tar.gz /etc/letsencrypt
exit

EOI


Updated
Now, the first part works, when it goes to second part begins at line ############### it says the following:



Command '.sudo' not found, did you mean:

command 'sudo' from deb sudo
command 'sudo' from deb sudo-ldap

Try: sudo apt install <deb name>


Someone shared a solution before but later removed it, I think that would work for me. :)



Why is it adding "." in front of all commands?







bash shell-script ssh terminal remote






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 1 at 10:22







Rakib Fiha

















asked Feb 28 at 19:01









Rakib FihaRakib Fiha

218




218












  • Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

    – Haxiel
    Mar 1 at 10:58











  • Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

    – Rakib Fiha
    Mar 1 at 15:38












  • Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

    – Haxiel
    Mar 1 at 16:15

















  • Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

    – Haxiel
    Mar 1 at 10:58











  • Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

    – Rakib Fiha
    Mar 1 at 15:38












  • Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

    – Haxiel
    Mar 1 at 16:15
















Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

– Haxiel
Mar 1 at 10:58





Your question seems to have gone through several revisions and changed entirely. The core of your problem still seems to be about here documents, so maybe some documentation will be useful. The 'tabs turning into dots' problem is discussed here: serverfault.com/q/898964/349846

– Haxiel
Mar 1 at 10:58













Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

– Rakib Fiha
Mar 1 at 15:38






Thank you very much, those documentations are gems. I copied and pasted my script from mac (sublime) to linux(vim) instead of using scp. Learnt a good and painful lesson.

– Rakib Fiha
Mar 1 at 15:38














Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

– Haxiel
Mar 1 at 16:15





Happy to hear that it worked out well. If you could write an answer here with the steps you took to solve the problem, it may be helpful to a future reader. Just something to consider. :-)

– Haxiel
Mar 1 at 16:15










0






active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503620%2fremote-ssh-script-execution-with-eoi-or-eossh-adding-dots-in-front-of-commands%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503620%2fremote-ssh-script-execution-with-eoi-or-eossh-adding-dots-in-front-of-commands%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay