I'm not sure if this should be here or over on AskDifferent, but I'm using a bash shell (iTerm) on MacOS. I sometimes have commands that produce additional commands that need to be copy/paste to the terminal.
An example of this is logging into the aws ecr:
aws ecr get-login --no-include-email --region -eu-west-1
This produces a multiline login hash that you need to copy and paste to the shell in order to successfully authenticate. Is there a way I can this and paste it from the keyboard or some command?
I've seen several ways to copy all of the output from a command to clipboard, but that's not exactly what I'm asking for. Specifically, I typically only want the last line in the output.
If nothing exists, I'd be perfectly happy with just setting up some sort of alias in my .bashrc
The recommended dupe answer expects you to use screen
- I don't want to use screen