Git Product home page Git Product logo

Comments (5)

mptre avatar mptre commented on September 6, 2024

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.

judovana avatar judovana commented on September 6, 2024

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.

judovana avatar judovana commented on September 6, 2024

closed :(

from yank.

mptre avatar mptre commented on September 6, 2024

My bad, I thought this issue was somewhat resolved?

from yank.

judovana avatar judovana commented on September 6, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.