0

I am doing a bioinformatics project that requires the use of this tool: https://github.com/rosericazondekon/virusSeqPipeline

The command to run this is bash runAll.sh, which is a shell script. When I run this, I receive back the following error:

runAll.sh: line 6: $'\r': command not found
runAll.sh: line 9: cd: $'/mnt/c/Users/user/Desktop/VirusSeqPipeline\r': No such file or directory
runAll.sh: line 10: $'\r': command not found
runAll.sh: line 11: $'\r': command not found
runAll.sh: line 51: syntax error near unexpected token `$'do\r''
'unAll.sh: line 51: `for sample in *; do

Does anyone know what would cause this?

  • 2
    You need to fix the file's line endings; see ["Are shell scripts sensitive to encoding and line endings?"](https://stackoverflow.com/questions/39527571/are-shell-scripts-sensitive-to-encoding-and-line-endings) – Gordon Davisson Feb 12 '23 at 07:42

1 Answers1

1

It looks like the script has Windows style end-of-line characters. You can try using dos2unix to correct the script.

This can occur when using FTP to move a file between Windows, Linux and Mac, using the binary transfer mode instead of text. Binary mode just copies the file exactly, whereas text mode will automatically convert the end-of-line characters to suit the target OS.

Lee
  • 149
  • 1
  • 8