Docker run/exec and carriage return

$docker exec -it container_name echo "Hello" Hello
$docker exec -it container_name echo "Hello" | od -c
0000000 H e l l o \r \n
0000007
$ssh user@remote_server "echo Hello" | od -c
0000000 H e l l o \n
0000006
$docker exec container_name echo "Hello" | od -c
0000000 H e l l o \n
0000006
$docker exec -it container_name echo "Hello" | tr -d '\r' | od -c
00000000 H e l l o \n
0000006
$docker exec -it container_name /bin/bash -c "stty -onlcr && echo 'Hello'" | od -c
0000000 H e l l o \n
0000006

--

--

--

SW engineer passionate about learning new technologies and reasonable usage of existing:)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Dell Wireless Keyboard Y-raq-del2 Driver For Mac

Modular Health System in Unity

Unity/C# Challenge 28: Secondary Fire Powerup

Guide to LockSupport in Java

Automating Rest API’s using Cucumber and Java

Top 10 Managed SD-WAN providers

Why not let APM do all the heavy lifting: beyond the basics of monitoring

How to Launch Parallel Tasks in Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dima Danilov

Dima Danilov

SW engineer passionate about learning new technologies and reasonable usage of existing:)

More from Medium

Running Keycloak on Docker

Docker & Nginx & Logs

Docker, nginx and reverse-proxying

How To Manage Docker Remotely