mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-23 02:35:38 +01:00
14 lines
292 B
Bash
14 lines
292 B
Bash
# Copies the contents of a given file or stdin to the system or X Windows
|
|
# clipboard
|
|
#
|
|
# Usage: copyfile [<file>]
|
|
function copyfile {
|
|
emulate -L zsh
|
|
|
|
clipcopy "${1-}" || {
|
|
echo "Usage: copyfile [<file>]"
|
|
return 1
|
|
}
|
|
|
|
echo ${(%):-"%B${1:-/dev/stdin}%b copied to clipboard."}
|
|
}
|