I hope the title makes sense.
I am trying to copy the last line of a file onto a file with same name on a remote server.
For example: copy last line of server1:/opt/users.txt to server2:/opt/users.txt
server1: cat /opt/users.txt
- john
- Kathy
- Sierra
server2: cat /opt/users.txt
- john
- Kathy
copy last line of server1:/opt/users.txt to server2:/opt/users.txt
output
server2: cat /opt/users.txt
- John
- Kathy
- Sierra