TransWikia.com

How to keep the format of text unchanged when I open it by Nano over ssh

Super User Asked by VU THANH VINH on December 24, 2020

I’m running this command to ssh into a server and open a textfile

sudo ssh -i ~/key.pem [email protected] -t "sudo nano /path/to/a/file.py"

In the nano editor, I’m seeing the ‘newline’ has been truncated

from base64 import urlsafe_b64encode import hashlib import hmac from django.utils.encoding import smart_str import time from
django.conf import settings

How can I keep the same format as origin of the file

from base64 import urlsafe_b64encode
import hashlib
import hmac
from django.utils.encoding import smart_str
import time

If I ssh, then type the command open nano manually, the original content is correct as above

Thank you!

Edit: I tried -N, also -w options it didn’t work. At the very beginning the editor already show ‘modifed’ though I did nothing
https://i.stack.imgur.com/CmxWj.png

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP