Use clipboard contents with Bash
-
So I had a scenario where I needed to connect to a few servers on the same port. You just need to copy the server name and run this script. This is a very specific example, but this is more to show how you can use the clipboard without pasting.
As this script implies, you need
xclip
installed as well.#!/bin/bash SERVER=$(xclip -o) ssh -L 8080:$SERVER:8080 server.example.com
-
Am I misunderstanding something? Because I have always used ctrl+shift+V to paste clipboard text into the terminal.
-
@obsolesce said in Use clipboard contents with Bash:
Am I misunderstanding something?
Yes. This is the script reading the clipboard into a variable.
-
@jaredbusch said in Use clipboard contents with Bash:
@obsolesce said in Use clipboard contents with Bash:
Am I misunderstanding something?
Yes. This is the script reading the clipboard into a variable.
Oh I see now, that's pretty neat.