What is my linux? I use ubuntu on WINDOWS 10 PRO - windows subsystem for linux.

Context the problem: I have two files. The first file is the name 'paths-linux.sh'. Your content is:


My second file is parquivo2.sh. Your content is:

. ./paths-linux.sh

echo 'Teste 1'
echo "${CAMINHO_DOIS}$vida"

echo 'Teste 2'
echo $CAMINHO_UM"vida"

echo 'Teste 3'
echo ${CAMINHO_TRES}"vida"


My output is:

Teste 1
Teste 2
Teste 3

I would like that my output was:

Teste 1
Teste 2
Teste 3

So, what's the problem? How I fix that? I would like use env file type. However that error is not missing when change type the file.

  • 1
    Likely your paths-linux.sh has Windows-style (CRLF) line endings instead of plain LF – steeldriver Oct 17 at 2:44
  • Run dos2unix on all your input files. Now, you see that because of these Windows line endings, each even line is folded at the end of your variable and "vida" is overwriting the same line, starting back from its beginning. – thanasisp Oct 17 at 2:58
  • I spended my all day with this before I ask. I am a beginner in linux. So,Thank you very much people! I install dos2unix and I run. The problem was fixed with this.. – Luiz Oct 17 at 3:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.