Comments (2)
#188 adds an example for pathvar add
in the table, but perhaps we should add a Path
section to the Environment page in the book? I'm currently documenting nushell/nushell#3950 on that page and I would gladly add information about working with the path env var as well.
from nushell.github.io.
In general, we could use some more information about manipulating the PATH in Nu.
We currently have pathvar
, which makes it very easy to add and remove specific paths. However, it is also possible to change the path by setting a value to the PATH
env var (or Path
on Windows). I don't know if this is intended or not?
> pathvar add ~/.local/bin
# works!
> let-env PATH = (pathvar | prepend ("~/.local/bin" | path expand) | str collect ":")
# also works!
Both of the above do the same thing. The second one is closer to what we usually see in other shells (and can be done with string concatenation to make it resemble that pattern even more).
Setting the PATH all at once as a string has its use cases, like restoring an old PATH when you don't know the number of elements you would like to remove. This happens when you're working with some virtual environments that add more than one path element.
I would like to document this, if it's intended to work like this.
from nushell.github.io.
Related Issues (20)
- lefthook does not work HOT 3
- Consider moving away from VuePress HOT 3
- Contributor book doesn't have sidebar to navigate HOT 6
- nushell.sh automatically uses http rather than https HOT 2
- Single page view of all docs/book? HOT 1
- Why I can not run `R.exe` in nushell? HOT 2
- Confusing example on script definition order HOT 3
- Generate terminal output HOT 1
- Step value of range is not mentioned in document HOT 1
- A page on control flow HOT 1
- Generate documentation for `std` commands
- Update modules page to disallow empty mod.nu HOT 1
- Issue with terminology in Thinking in Nu page HOT 3
- Add documentation for multi-dot paths HOT 1
- rewrite docs suggestion HOT 10
- Remove `$nothing` from document HOT 1
- Replace std testing with nupm HOT 5
- Explanations in the cheat sheet should come before the code that's explained HOT 2
- The Cookbook Setup page references the now-removed `env` command several times HOT 2
- Broken links HOT 4
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 nushell.github.io.