Comments (8)
Create a temp file, pipe in the output from the alias
command and grep through it for alias \""$1"
at the beginning of each line?
from myaliases.
Maybe this will help?
It says you can use the unalias
command.
from myaliases.
I reverse engineered this basically xD thanks though, useful suggestions
from myaliases.
Most relevantly: what should the behavior be in this edge case? Should we:
- unalias the old command and set the new command? (If so, should we do this explicitly with an unalias in the generated file or silently override it?)
- check if we set the old command in our generated file and delete that line? Is this even a desired behavior?
- reject the new command?
from myaliases.
Since this command is all about convenience, I would have it override the old alias and not reject the new command. I would also check the generated file and delete if necessary. I'm also generally a fan of doing things silently, but we could echo out a statement telling the user that their old alias has been overridden if you want. However, if you do that, you might only want to do it when it's from our generated file so that we can stay true to the original behavior of alias
in case any other programs assume that it won't print anything.
from myaliases.
Oooh, that sounds like a great way to handle it. Currently I have it failing verbosely, but that shouldn't be terrible to implement.
(side note for future me: will involve grep, probably, and a little bit of ed. and much regex.)
from myaliases.
Currently deletes the old alias silently from .usr_aliases
and does nothing otherwise.
This seems to work for for all cases quite well; I'd probably only be worried about order if they try to override a name that someone is already using. Because then inclusion in how things get called from the .bashrc
matters a lot as far as what actually gets defined.
from myaliases.
This happens when I leave projects for a long time; I forget why I haven't closed issues. I'm going to close this, because my previous comments sound pretty resolvey to me?
from myaliases.
Related Issues (20)
- options HOT 6
- Reran install script and .included gave me this HOT 2
- cds - too many file descriptors? HOT 3
- wiki better m8 HOT 1
- cds tab complete shell conditional agh HOT 2
- add guidance about setup/install to wiki
- document git and hg and grep
- prepending .included line into .bash_aliases HOT 7
- comments in cds command
- unalias for altalias? HOT 1
- double slashes in cds tab completion HOT 3
- alias in alias command
- test suite HOT 3
- Setup script's jank on an RPI HOT 6
- Setup script should finish off by sourcing HOT 1
- Somehow enforce make
- some ideas
- cds - is not portable
- wsl open cmd overrides default open cmd HOT 2
- WSL 2 alternative to SFTP Net Drive using SSHFS 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 myaliases.