Created
May 8, 2019 12:16
-
-
Save vluzrmos/56372cf9fa16e417169e81a8dea0fd0c to your computer and use it in GitHub Desktop.
Write into a SSH Remote File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo 'Some Text' | ssh user@remotehost -T "cat > /remotefile.txt" | |
# The -T disables pseudo-terminal allocation and stops you from getting the message, | |
# Pseudo-terminal will not be allocated because stdin is not a terminal. | |
# @see https://superuser.com/a/400720/341320 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment