0

I am using windows bash I have pull.sh

File pull .sh

cd D:\\New\ folder\ \(8\)
git pull

I am run command PS D:\> bash pull.sh but it give me error even directory exists it adding r in path which I have not given

pull.sh: line 1: cd: $'D:\New folder (8)\r': No such file or directory

Artier
  • 1,648
  • 2
  • 8
  • 22
  • And if you try it with a path that does not have spaces and silly parenthesis? – Anders Sep 19 '22 at 10:03
  • 2
    convert your file from CRLF to LF – phuclv Sep 19 '22 at 10:03
  • Your script has DOS/Windows line endings, which won't work with unix tools like the shell. See ["Are shell scripts sensitive to encoding and line endings?"](https://stackoverflow.com/questions/39527571/are-shell-scripts-sensitive-to-encoding-and-line-endings) for more info and how to solve this. Also, unix paths are different from Windows paths. I think you want `cd '/mnt/d/New folder (8)'`, but I'm not sure about that. See [this HowToGeek article](https://www.howtogeek.com/261383/how-to-access-your-ubuntu-bash-files-in-windows-and-your-windows-system-drive-in-bash/). – Gordon Davisson Sep 19 '22 at 16:49

0 Answers0