Skip to content

Instantly share code, notes, and snippets.

@vluzrmos
Created May 8, 2019 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vluzrmos/56372cf9fa16e417169e81a8dea0fd0c to your computer and use it in GitHub Desktop.
Save vluzrmos/56372cf9fa16e417169e81a8dea0fd0c to your computer and use it in GitHub Desktop.
Write into a SSH Remote File
#!/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