Comments (8)
Your shell performs pattern matching on the asterisk, although it is quoted. Weird.
Which shell do you use?
from hr.
Hi @svenXY,
As @jomo said, it's probably your shell doing expansion before passing it to the script, you can test this easily to see it for yourself:
$ echo '*'
I bet you will get aaa bbb ccc ddd
if your shell is indeed expanding it. I don't know which shell you are using, but you can try with double quotes to see if it doesn't expand anymore.
In bash and zsh, these are my results:
$ ls
aaa bbb ccc ddd
$ echo "*"
*
$ echo '*'
*
$ echo *
aaa bbb ccc ddd
I hope this helps!
from hr.
Yes, it does expand the asterisk although it is quoted:
> echo $SHELL
/usr/bin/zsh
> hr.sh '*'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ddddddddddddddddddddddddddddddddddddddddddddddddddd
> echo '*'
*
> bash
$ echo '*'
*
$ hr.sh '*'
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddddddddddddddddddd
See? Problem persists.
FWIW: I also tried the hr.py approach and it works fine.
from hr.
Hmmmm, that is very interesting, I can't reproduce that behaviour with my zsh, could you make sure that you have the latest version of hr?
Also, you can try these different scenarios:
- Move ~/.zshrc to some other file to test with pure zsh (maybe your config has something special)
- Run this command on your shell:
/usr/bin/env bash
this is the shebang and although I'm fairly sure you probably havebash
andenv
, there may be something funny happening there.
Apart from this, I don't know what to try, I'm guessing that bash is expanding the value somewhere in the script, but the only way to know is by debugging, and unfortunately I cannot replicate it.
Please tell me if any of that worked.
from hr.
Nothing helped, whatever I did in zsh and bash, and in whatever terminal (urxvt, xfce4-terminal) and with some different TERM settings (xterm-256color, rxvt-unicode-256color), problem persists.
Since hr.py works fine for me, it is now purely academical, but maybe you are more concerned???
Thanks for your help anyway.
Sven
from hr.
Yeah, I'm still worried about it, since if it happened to you, it may happen to someone else in the future, hopefully we'll be able to figure out the problem.
Thanks for your contribution!
from hr.
Let me know how I can help you further and I'm glad to do so, but I'm out of ideas currently.
from hr.
Perhaps try noglob
? noglob hr *
from hr.
Related Issues (13)
- Unlicense HOT 5
- Add support for multiple lines HOT 1
- Cut a release HOT 3
- Integration with PS1 HOT 3
- Homebrew install doesn't work HOT 2
- Adding hr to jean HOT 3
- Man page HOT 6
- Release HOT 4
- Different port to C HOT 2
- Suggestion: Colour support HOT 2
- License? HOT 2
- [Feature request] Config hr default text `#` through environment variable HOT 2
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 hr.