Comments (4)
Makes sense, thanks for reporting! Yes, the expansions get saved to the user file wrapped in double quotes. The original quote level should be preserved if possible.
It'll be probably a couple weeks before I'm able to look into it. In the meantime, single quotes will work too if you don't want to gunk up your command with slashes, and the echo's will work without quotes. And it's outside my wheelhouse but in at least some circumstances kubectl's --selector doesn't need quotes.
Cool use case, I hadn't thought to use a single abbreviation for a string of commands. I like it.
from zsh-abbr.
Looking in ~/.config/zsh/abbreviations
, I can see the single quotes have been replaced with double-quotes.
abbr nodes="echo "MASTERS" && kubectl get nodes --selector="kubernetes.io/role=master" && echo "REGULAR NODES" && kubectl get nodes --selector="kubernetes.io/role!=master,dedicated!=heavy" && echo "HEAVY NODES" && kubectl get nodes --selector="kubernetes.io/role!=master,dedicated=heavy""
from zsh-abbr.
Editing this file to escape the quotes fixes the error, so the solution would seem to be doing this escaping of double quotes on persisting the values.
abbr nodes="echo \"MASTERS\" && kubectl get nodes --selector=\"kubernetes.io/role=master\" && echo \"REGULAR NODES\" && kubectl get nodes --selector=\"kubernetes.io/role!=master,dedicated!=heavy\" && echo \"HEAVY NODES\" && kubectl get nodes --selector=\"kubernetes.io/role!=master,dedicated=heavy\""
from zsh-abbr.
Fixed in 3.1.2!
If you version control your user abbreviations file you'll probably see some noise after the first time you make a change to any user abbreviations via the command line (ie after the first time abbr updates the user file) — more double quotes, more \
s. You don't have to change the way you write expansions, either interactively or editing the user abbrevations file directly — zsh will figure out the quoting / escaping as needed.
from zsh-abbr.
Related Issues (20)
- `zsh-abbr` not working when the `viins` keymap is selected HOT 5
- abbr command completion
- [Bug report] bad math expression: operator expected at `Jan 1 03:...' HOT 4
- [feature] abbreviations may place the cursor anywhere in the expansion, instead of only at the end HOT 1
- Could you publish tarball for v4.8? HOT 3
- Cannot use scopes HOT 2
- Drop .zwc files from repo HOT 6
- Could you publish tarball for v4.8.2? HOT 1
- zsh-autosuggestions' suggestions don't clear after the line is accepted HOT 13
- [Bug report] testing issue form
- [Bug report] One more .zwc in repo remains HOT 2
- Deleted the branch `master`
- acknowledge committers
- allcontributors 1/ HOT 2
- acknowledge bug reporters HOT 1
- `!` is escaped in v5, but wasn’t in v4 HOT 12
- `abbr c` does not clear abbreviations created with the pattern `abbr x=y` HOT 3
- Teach `add` about `--force`
- [Bug report] involuntary history filtering possible in combination with zsh-autosuggestions and v5.x HOT 11
- Conflict warning logged in all new sessions when adding an abbreviation in zshrc 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 zsh-abbr.