-
-
Save lucenarenato/3341d70f8200eefd6d9430a0a77b0804 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