Comments (4)
What shfmt
version is this? On master, I don't see this:
$ echo 'cat file >&2' | shfmt -p
cat file >&2
from sh.
Would also help if you uploaded the file. This could happen if the file has non-printable characters hidden between >&
and 2
, in which case the parser should give a better error message.
from sh.
Actually, this happens if I put the lines in a file, but not from the command line. What the hell?
In any case you're right - sorry for the noise.
from sh.
Ah, I only apply -p
if running on files, not on stdin. Ouch.
from sh.
Related Issues (20)
- shfmt breaks hashes for associative arrays that contain dashes HOT 2
- Inline formatting single file: Breaks symlink and creates a regular file instead of retaining symlink HOT 1
- cmd/shfmt: document how --filename relates to EditorConfig support HOT 6
- When processing a bash script, `shfmt` defaults to using `POSIX` syntax rules instead of bash-specific syntax HOT 1
- editorconfig - accept simplify and minify flags? HOT 1
- Multiple commands in one line HOT 2
- emulate beautysh `--force-function-style` HOT 1
- interp: bash runs scripts if kernel returns ENOEXEC HOT 1
- Formatting suggestion: if-blocks with multiple conditions HOT 2
- Space redirects `-sr` also seem to convert space indents to tabs HOT 2
- interp: here-doc backslash is not preserved HOT 1
- syntax: Parser does not handle unescaped slash as original value in replacement parameter expansion HOT 3
- request: Include Windows ARM64 precompiled binary
- man page: incorrect statement regarding use of `-` (read from stdin) and `--filename` flag
- Variable transformation does not work with arrays HOT 2
- Associative array access with concatenated keys without quotes fails to parse HOT 1
- Quoted backtick command substitution replacement doesn't unescape quotes HOT 1
- Comments in a subshell are moved every time the formatter runs
- interp: heredocs get consumed by the first command process executed HOT 1
- Arithmetic expansion: "= must follow a name" when variable expansion is used 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 sh.