Comments (5)
This is happening due to the fact that echo
behaves differently between bash
and dash
:
$ cat /tmp/test.sh
#/bin/sh
echo "One\nTwo"
$ bash /tmp/test.sh
One\nTwo
$ dash /tmp/test.sh
One
Two
and from what I can read, jq is following JSON guidelines, which means forbidding multi-line strings with double quotes.
On bash
, it works fine as the JSON given has a plain \n
, whereas on dash, it has a literal newline, which breaks the program.
I'd say that there is no real reason to send the data from the plain JSON files to stdout
when jq
already can parse from a file via CLI. I published a fix in #23.
From Wikipedia:
Nowadays, several incompatible implementations of
echo
exist on different operating systems (often several on the same system), some of them expanding escape sequences by default, some of them not, some of them accepting options (the list of which varying with implementations), some of them not.The POSIX specification of
echo
leaves the behaviour unspecified if the first argument is-n
or any argument contain backslash characters while the Unix specification (XSI option in POSIX) mandates the expansion of (some) sequences and does not allow any option processing. In practice, manyecho
implementations are not compliant in the default environment.Because of these variations in behaviour,
echo
is considered a non-portable command on Unix-like systems and theprintf
command (where available, introduced by Ninth Edition Unix) is preferred instead.
from xdg-ninja.
That's pretty weird, what do you have /bin/sh symlinked to?
from xdg-ninja.
It's linking to /bin/dash
.
from xdg-ninja.
I don't have any experience with that unfortunately, maybe @Ballasi could take a look at this as well?
from xdg-ninja.
I'm using KDE Neon, which is based on Ubuntu. Please let me know if you want to know any more details.
from xdg-ninja.
Related Issues (20)
- Detection missing for .gtk-bookmarks
- Detection missing for .irb_history
- Detection missing for GNU Solfege
- Detection missing for uim.d
- Detection missing for jack
- Detection missing for .hyprland
- Detection missing for .krew
- Move references to issues and versions supporting XDG to separate keys
- More dotfiles HOT 1
- A better python_history solution HOT 2
- Explain when and where to move files HOT 1
- Feature request: only show actionable points HOT 2
- Update xdg ninja to say that the .minecraft folder can't be moved because the --workDir flag broke.
- [BUG] xdg-ninja says to move ~/.fonts.conf to $XDG_DATA_HOME instead of $XDG_CONFIG_HOME HOT 1
- Allow list support
- Add flake-compat
- Makefile could use 'chmod' on programs subdirectory
- Update swifttmp HOT 1
- AWS report is incorrect
- More dotfiles 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 xdg-ninja.