2

I am getting error below error while executing a program.

sh: 1: export: Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_1804.2019.522.0_x64__79rhkp1fndgsc:/mnt/c/Program: bad variable name

I know it is the space in "Program File" that is messing up. Also, I did not create the program. There are lot of scripts so i am not sure which script is calling it. My window version is Windows 10 Insider Preview 10.0.19041.21 (vb_release).

How can i fix it ? Can i edit path variable or something like that.

2 Answers2

1

One solution is to use the 8.3 names.

In windows command prompt, type

cd /d C:\
dir /x

You will see something like

08/03/2020  20:20    <DIR>                       $WINDOWS.~BT
03/11/2018  16:56    <DIR>                       dell
08/03/2020  22:33    <DIR>                       ESD
06/12/2019  03:16    <DIR>                       inetpub
19/03/2019  04:52    <DIR>                       PerfLogs
06/12/2019  04:17    <DIR>          PROGRA~1     Program Files
06/12/2019  04:17    <DIR>          PROGRA~2     Program Files (x86)
03/03/2020  15:24    <DIR>          PROGRA~3     ProgramData
05/12/2019  20:39    <DIR>                       Users
12/02/2020  18:46    <DIR>                       Windows

In this case, if you want Program Files use progra~1 (it ignores case). If you want to use Program Files (x86) use progra~2

cup
  • 236
0

I'm not sure if my issue which I solved is same as yours, however, it looks very similar. I hope my steps can be of any help.

My issue was happening when I was trying to launch my wsl/ubuntu from Win10. I would get the following error:

-sh: 6: export: Files/WindowsApps/CanonicalGroupLimited.Ubuntu18.04onWindows_2020.1804.7.0_x64__79rhkp1fndgsc:/mnt/c/Program: bad variable name

  1. Make sure you are in root. sudo su -
  2. chsh -s $(which bash)
  3. Close current WSL window and launch new one.
Celly
  • 101