aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/%HOME%
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-04-26 16:17:58 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-04-26 16:18:51 +0200
commit1d9b6107e0d2efd2af58c8848254f27d2cfb189b (patch)
tree4461be0b3fd09b9c83bf1232afd1a62b5adbf424 /%HOME%
parentos.sh: support Debian (diff)
downloadlinux-home-1d9b6107e0d2efd2af58c8848254f27d2cfb189b.tar.gz
linux-home-1d9b6107e0d2efd2af58c8848254f27d2cfb189b.zip
bash: support copy alias on multiple platforms
Diffstat (limited to '%HOME%')
-rw-r--r--%HOME%/.bashrc10
1 files changed, 9 insertions, 1 deletions
diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc
index 561eef9..56dc679 100644
--- a/%HOME%/.bashrc
+++ b/%HOME%/.bashrc
@@ -95,7 +95,15 @@ alias tree='tree -a'
alias sed='sed --follow-symlinks'
-alias copy='xclip -sel clip'
+# Use in a pipeline:
+# command | copy
+if os_is_linux; then
+ alias copy='xclip -sel clip'
+elif os_is_cygwin; then
+ alias copy='cat > /dev/clipboard'
+elif os_is_macos; then
+ alias copy='pbcopy'
+fi
# Make sure ssh-copy-id copies public keys along with their comments.
alias ssh-copy-id='ssh-copy-id -i'