Score:0

This message showed when I opened the terminal. I downloaded Ubuntu 20.04 LTS on Windows10 Linux subsystem. Help pls!

cn flag
-bash: /home/rafsan/.bash_profile: line 1: syntax error near unexpected token `(' -bash: /home/rafsan/.bash_profile: line 1: `export PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu20.04onWindows_2004.2021.825.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/ProgramData/Oracle/Java/javapath:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/D3DGear:/mnt/c/Users/rafsa/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/rafsa/AppData/Local/Programs/Python/Python39/:/mnt/c/Users/rafsa/AppData/Local/Microsoft/WindowsApps:/mnt/c/Program Files/JetBrains/PyCharm 2021.1/bin:/mnt/c/Python39/Scripts:/snap/bin'
hr flag
Related: [bad variable name error on WSL](https://askubuntu.com/questions/1354999/bad-variable-name-error-on-wsl)
Score:1
it flag

After reformatting your question with <code>...</code> tags, we see that an initial login instance of bash (that's what the first "-" says, see man bash) has a problem with line 1 of .bashrc. It then shows us that line, the overly long "PATH" setting.

Linux shells use the ASCII "space" character as an argument separator, and "()" for subshells. There are more of these "Special Characters", see https://mywiki.wooledge.org/BashGuide/SpecialCharacters

To remove the "specialness" of these characters, put a backslash ("\") in front of each.

E.g. replace Program Files (x86) with Program\ Files\ \(x86\) .

A better way to manipulate PATH is with Stephen Collyer's bash_path_funcs, described in Linux Journal way back in 2000:

https://www.linuxjournal.com/article/3645 https://www.linuxjournal.com/article/3768 https://www.linuxjournal.com/article/3935

The addpath function adds an entry to a path only if it is not there in the first place. delpath -n deletes all non-existent directories from a path.

You can get the pathfunc.tgz file from https://web.archive.org/web/20061210054813/http://www.netspinner.co.uk:80/Downloads/pathfunc.tgz

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.