Running Script made in Visual Studio Code (on windows) on WSL Ubuntu returns “line 2: $'r': command not found” [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite
2












When I try to run a script made with Visual Studio Code on Windows in my Ubuntu WSL installation, I get the error:



line 2: $'r': command not found


I ran into the question below:



How do I fix "$'r': command not found" errors running Bash scripts in WSL?.



That all makes sense, however is there a way/setting on Visual Studio Code on windows to not have to use the dos2unix utility every time?







share|improve this question














closed as off-topic by muru, N0rbert, Fabby, David Foerster, Kevin Bowen May 18 at 5:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – muru, N0rbert, Fabby, David Foerster, Kevin Bowen
If this question can be reworded to fit the rules in the help center, please edit the question.












  • See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
    – steeldriver
    May 15 at 0:31















up vote
1
down vote

favorite
2












When I try to run a script made with Visual Studio Code on Windows in my Ubuntu WSL installation, I get the error:



line 2: $'r': command not found


I ran into the question below:



How do I fix "$'r': command not found" errors running Bash scripts in WSL?.



That all makes sense, however is there a way/setting on Visual Studio Code on windows to not have to use the dos2unix utility every time?







share|improve this question














closed as off-topic by muru, N0rbert, Fabby, David Foerster, Kevin Bowen May 18 at 5:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – muru, N0rbert, Fabby, David Foerster, Kevin Bowen
If this question can be reworded to fit the rules in the help center, please edit the question.












  • See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
    – steeldriver
    May 15 at 0:31













up vote
1
down vote

favorite
2









up vote
1
down vote

favorite
2






2





When I try to run a script made with Visual Studio Code on Windows in my Ubuntu WSL installation, I get the error:



line 2: $'r': command not found


I ran into the question below:



How do I fix "$'r': command not found" errors running Bash scripts in WSL?.



That all makes sense, however is there a way/setting on Visual Studio Code on windows to not have to use the dos2unix utility every time?







share|improve this question














When I try to run a script made with Visual Studio Code on Windows in my Ubuntu WSL installation, I get the error:



line 2: $'r': command not found


I ran into the question below:



How do I fix "$'r': command not found" errors running Bash scripts in WSL?.



That all makes sense, however is there a way/setting on Visual Studio Code on windows to not have to use the dos2unix utility every time?









share|improve this question













share|improve this question




share|improve this question








edited May 15 at 3:30









ubashu

2,23721736




2,23721736










asked May 15 at 0:20









0siris

185




185




closed as off-topic by muru, N0rbert, Fabby, David Foerster, Kevin Bowen May 18 at 5:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – muru, N0rbert, Fabby, David Foerster, Kevin Bowen
If this question can be reworded to fit the rules in the help center, please edit the question.




closed as off-topic by muru, N0rbert, Fabby, David Foerster, Kevin Bowen May 18 at 5:10


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "This is not about Ubuntu. Questions about other Linux distributions can be asked on Unix & Linux, those about Windows on Super User, those about Apple products on Ask Different and generic programming questions on Stack Overflow." – muru, N0rbert, Fabby, David Foerster, Kevin Bowen
If this question can be reworded to fit the rules in the help center, please edit the question.











  • See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
    – steeldriver
    May 15 at 0:31

















  • See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
    – steeldriver
    May 15 at 0:31
















See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
– steeldriver
May 15 at 0:31





See Create portable, custom editor settings with EditorConfig - in particular the end_of_line property
– steeldriver
May 15 at 0:31











1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted











In the bottom-right corner of the window there is an indicator that
says CLRF or LF [highlighted in green on the picture] which will let you set the line endings for a
particular file. Clicking on the text will allow you to change the
line endings as well.



enter image description here







CR is a bytecode for carriage return (from the days of typewriters) and LF similarly, for line feed. It just refers to the bytes that are placed as end-of-line markers.




Sources and references:




  • Visual Studio Code: How to show line endings.


  • VSC on GitHub: How to replace characters as newline break.

  • Difference between CR LF, LF and CR line break types?





share|improve this answer






















  • Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
    – pa4080
    May 15 at 4:45










  • Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
    – 0siris
    May 15 at 15:17

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted











In the bottom-right corner of the window there is an indicator that
says CLRF or LF [highlighted in green on the picture] which will let you set the line endings for a
particular file. Clicking on the text will allow you to change the
line endings as well.



enter image description here







CR is a bytecode for carriage return (from the days of typewriters) and LF similarly, for line feed. It just refers to the bytes that are placed as end-of-line markers.




Sources and references:




  • Visual Studio Code: How to show line endings.


  • VSC on GitHub: How to replace characters as newline break.

  • Difference between CR LF, LF and CR line break types?





share|improve this answer






















  • Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
    – pa4080
    May 15 at 4:45










  • Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
    – 0siris
    May 15 at 15:17














up vote
2
down vote



accepted











In the bottom-right corner of the window there is an indicator that
says CLRF or LF [highlighted in green on the picture] which will let you set the line endings for a
particular file. Clicking on the text will allow you to change the
line endings as well.



enter image description here







CR is a bytecode for carriage return (from the days of typewriters) and LF similarly, for line feed. It just refers to the bytes that are placed as end-of-line markers.




Sources and references:




  • Visual Studio Code: How to show line endings.


  • VSC on GitHub: How to replace characters as newline break.

  • Difference between CR LF, LF and CR line break types?





share|improve this answer






















  • Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
    – pa4080
    May 15 at 4:45










  • Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
    – 0siris
    May 15 at 15:17












up vote
2
down vote



accepted







up vote
2
down vote



accepted







In the bottom-right corner of the window there is an indicator that
says CLRF or LF [highlighted in green on the picture] which will let you set the line endings for a
particular file. Clicking on the text will allow you to change the
line endings as well.



enter image description here







CR is a bytecode for carriage return (from the days of typewriters) and LF similarly, for line feed. It just refers to the bytes that are placed as end-of-line markers.




Sources and references:




  • Visual Studio Code: How to show line endings.


  • VSC on GitHub: How to replace characters as newline break.

  • Difference between CR LF, LF and CR line break types?





share|improve this answer















In the bottom-right corner of the window there is an indicator that
says CLRF or LF [highlighted in green on the picture] which will let you set the line endings for a
particular file. Clicking on the text will allow you to change the
line endings as well.



enter image description here







CR is a bytecode for carriage return (from the days of typewriters) and LF similarly, for line feed. It just refers to the bytes that are placed as end-of-line markers.




Sources and references:




  • Visual Studio Code: How to show line endings.


  • VSC on GitHub: How to replace characters as newline break.

  • Difference between CR LF, LF and CR line break types?






share|improve this answer














share|improve this answer



share|improve this answer








edited May 15 at 17:15

























answered May 15 at 4:18









pa4080

11.9k52255




11.9k52255











  • Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
    – pa4080
    May 15 at 4:45










  • Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
    – 0siris
    May 15 at 15:17
















  • Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
    – pa4080
    May 15 at 4:45










  • Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
    – 0siris
    May 15 at 15:17















Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
– pa4080
May 15 at 4:45




Sorry, I committed this common mistake and didn't read the question to the end, before threw my answer. Then I found my answer is incorrect and the question is off topic, but I decided to recreate my answer...
– pa4080
May 15 at 4:45












Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
– 0siris
May 15 at 15:17




Thank you for the quick reply. I also appreciate you posting the sources, it was educational and makes sense.
– 0siris
May 15 at 15:17


Popular posts from this blog

Unable to execute new pre-installation script (/var/lib/dpkg/tmp.ci/preinst)

Running the scala interactive shell from the command line

Do not install recommended packages of dependencies