Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/kasper9n/my-bash-scripts. My personal bash scripts
Something went wrong. Try again.
361 B · 18 lines
at master
12345678910111213141516171819#! /bin/bash
help() { echo "Run a command and copy the output to the clipboard." echo "For example, run `color 3 copy pwd` to copy the current path." echo "" echo "`color 2 Usage:` copy <command> [args...]" echo ""}
ARG1="$1"if [[ $ARG1 ]]; then output=$(eval "$@") echo "$output" echo "$output" | pbcopy -selection clipboardelse helpfi