using cd command in a bash script

31 Views Asked by At

I am currently trying to run a bash script to jump between specific directories and print out all the .cpp and .h files found in that directory.

But when i try to use the cd command in the .sh, I get the error "no such working directory".

e.g. cd myDir

but the script returns, cd: $'myDir\r': No such file or directory

I dont understand why the \r is there, or how to remove it.

When i run the command from the terminal i have no issues. Any ideas where im going wrong?

Thanks in advance

0

There are 0 best solutions below