Giter Site home page Giter Site logo

Comments (2)

tlin623 avatar tlin623 commented on June 5, 2024 1

@michaeltreat it worked! thanks so much for your quick response.

from windows-subsystem-for-linux-setup-guide.

michaeltreat avatar michaeltreat commented on June 5, 2024

Hey @tlin623 , thanks for the compliments on the guide!

This is my bad. The issue is that we should be de-referencing the bash variable when using it, and we should be doing that wether it's a path with a space or not. I will go in and update that line in the guide!

To de-reference a variable, you invoke it with double quotes around it.

Here's an example:

Incorrect:
If you type $wr then you'll see the error : no such file or directory

Correct
But, if you type "$wr" then bash will tell you it's a directory.

Note the double quotes around this variable when you call it. That's called de-referencing the variable.

Solution
Your code should look like this:

export wr=~/../../mnt/c/Users/FirstName\ LastName/
alias cdwr='cd "$wr"'

Note the backslash escape character to escape the space between your first and last name.
Also note the double quotes around $wr

This is the link to StackOverflow where I found the answer.

I tested this on my machine and it works, but let me know if it works for you!

Thanks again!

from windows-subsystem-for-linux-setup-guide.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.