GithubHelp home page GithubHelp logo

.sh script on /mnt/d about wsl HOT 3 CLOSED

microsoftdocs avatar microsoftdocs commented on August 19, 2024
.sh script on /mnt/d

from wsl.

Comments (3)

jessicah avatar jessicah commented on August 19, 2024 2

Are you sure you're using Unix newlines in your script? Sounds like it's possibly choking on a \r. If you add the typical #!/bin/bash to top of your script, you'll get the error: line 2: $'\r': command not found, whereas without the shebang, you'll just get the syntax error on the done line.

These are binaries straight from Ubuntu, so they typically will not support Windows newlines.

from wsl.

jessicah avatar jessicah commented on August 19, 2024 1

@SonGokussj4 if you moved/created the file from Win32, the Linux filesystem likely will have issues with the file. Manipulating files under %APPDATA%\lxss from Win32 is unsupported and will have bizarre side effects. You should copy files there using the Linux environment.

from wsl.

SonGokussj4 avatar SonGokussj4 commented on August 19, 2024

Thank you for your response. It was really that. Sublime set the new lines to [Windows]. I think.
Now whe set to [Unix], it works well in [ST3]
So thank you again :-)

How does the "unix place detachement" works?
When I create shell script and move it into:
/mnt/c/Users/my_user/AppData/Local/lxss/root/ScriptFolder#

  • I can see it in Windows

  • I can see it in bash when i go to:

    cd /mnt/c/Users/my_user/AppData/Local/lxss/root/ScriptFolder/

  • I can't see it in bash when i go to cd ~/ScriptFolder/

from wsl.

Related Issues (20)

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.