Terminal copier

I’ve made a small script to easily copy terminal output. It can b e found here:

It can also be included in a package or something with Manjaro, if you think it’s a good idea…

1 Like

Seems reasonable. :+1:

I have a few comments, I hope you don’t mind.

echo “source <fileLocation>/tcp.sh” >> <configFile>

There should be a check to see if the file exists. So something like:

echo "[[ -f <fileLocation>/tcp.sh ]] && source <fileLocation>/tcp.sh" >> <configFile>

Re-login to your computer. It should now be usable

Just source the .zshrc or .bashrc, or open a new terminal which will do it for you.

I’d think about echoing the output so the user can see it, and maybe checking for an empty string and replacing it with something more explicit.

There are a few typos in the comments.

1 Like

Just copy it anywhere you like. For exaample, I’m using /usr/local/bin/

Why not use it as a script ? /usr/local/bin/tcp
And i can use with my fish shell :grinning:
Only add at end:

if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
    tcp "$@"

Note: xsel is only for x11 …

Yes, you may and I appreciate it. I think I implemented everything…and corrected what typos I could find.

1 Like

You mean remove the extension? No reason for it to be or not be there.

O Yeah! Tried implementing a check for that, please see if it’s correct.