Comments (5)
Hi,
This is not the intended use-case for yank. However, here's a few ideas.
so echo a b | yank -A
You could just use the underlying command yank make use of to copy
directly to the clipboard:
$ echo a b | xsel
Make sure to replace xsel
with the correct command based on your
platform.
so echo a b | yank -A 2
In this scenario, I assume you would like to use yank's ability to
extract fields. However, I would suggest using cut(1)
or awk(1)
if
you already know the which field to copy and the fields are delimited in
a fairly simple manner:
$ echo a b | awk '{print $2}' | xsel
$ echo a b | cut -d ' ' -f 2 | xsel
In more complex situations, for instance: copying the last column on
the second line:
$ printf '1 2 3\n4 5 6\n7 8 9\n' | awk 'NR==2 {print $NF}' | xsel
If the fields are delimited comma and not whitespace:
$ echo '1,2,3' | awk -F, '{print $1}' | xsel
I hope you find the examples useful.
from yank.
Hi!
Indeed the examples are useful!
My "issue" is probably pure laziness One uses yank and suddenly he found himself repeating the same keystroke sequence. So yes, where xsel + cut/awk is clear choice, yank can serve as proper replacement.
Still, feel free to close the issue as the examples are kick-the-lazy who only wont to pres "up arrow" in terminal ;)
thanx!
from yank.
closed :(
from yank.
My bad, I thought this issue was somewhat resolved?
from yank.
Of course it was! Still the hope was there :( If I will find time to get back to C, You will get and push request;)
from yank.
Related Issues (20)
- yanking without input HOT 6
- Fedora RPM's HOT 3
- Stripping debug info HOT 5
- yank only sees the first page HOT 2
- How to use yank over ssh? HOT 6
- Crashes when using -g with -l or -d HOT 1
- How to yank to clipboard? HOT 1
- suggestion: delimiter command HOT 1
- Why doesn't `... -- <command>` work? HOT 1
- Skip fields using hotkey like ctrl-arrow or ctrl-end, ctrl-home keys? HOT 1
- Setting YANKCMD to "xsel --clipboard" HOT 2
- Copy all output? HOT 3
- Install failed on Ubuntu 20.04.2 HOT 2
- jump across filenames with specific extension HOT 2
- Yank not using xsel on Ubuntu 20/22? HOT 4
- `--select-1` option similar to fzf HOT 3
- Make yank not depend on `xsel` HOT 1
- Bug: newline as delimiter works as 2 delimiters: newline and 'n' HOT 1
- Bug: the results list gets cut to the number of lines that fit visible area HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yank.