milianw / shell-helpers Goto Github PK
View Code? Open in Web Editor NEWa bunch of little programs I wrote to make my life on the command line easier and less type-intensitive
Home Page: http://milianw.de/code-snippets
License: Other
a bunch of little programs I wrote to make my life on the command line easier and less type-intensitive
Home Page: http://milianw.de/code-snippets
License: Other
If you execute
echo "hello" | clipboard.sh
you see an extra empty line, written in your screen; that is to say:
$ echo "hello" | clipboard.sh
but you should only see
$ echo "hello" | clipboard.sh
without that extra empty line. For example, if you execute
echo "hello" | awk
you see that no extra empty line appears (because awk has caught all that it was feeded).
Also, if you execute
echo "hello" | clipboard.sh
and you "edit/paste" in a text editor, you get there:
hello
with that empty line at the end; this is all right. But if you execute
echo -n "hello" | clipboard.sh
and you "edit/paste" in a text editor, you get there:
hello
with that empty line at the end. That empty line should not exist, because you have used the "-n" argument (*).
(*) Like in
echo -n "hello" >> /tmp/file
echo -n "hello" >> /tmp/file
echo -n "hello" >> /tmp/file
echo -n "hello" >> /tmp/file
cat /tmp/file
hellohellohellohello
Thanks!
Don't add newline to clip board contents and don't print anything when we set the contents.
Note that the case of 'echo "hello" | clipboard' will now not include a trailing newline.
This is still a bit better (imo) compared to before.
Yes, in my opinion, too.
On the other hand, I have detected a bug in the "clipboard.sh" of the 6th of August:
If I execute:
echo a > /tmp/place
cat /tmp/place | clipboard
clipboard
it returns
a
and that's ok.
However, if I execute:
echo b > /tmp/place
clipboard < /tmp/place
clipboard
it returns
b
b
and that's an extra "b".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.