riscv-ovpsim / imperas-riscv-tests

161 stars 37 forks source link

Example shell scripts for Linux have CRLF line terminators #25

Open CBindahouse opened 1 year ago

CBindahouse commented 1 year ago

The example shell scripts (e.g. RUN_RV32_fibonacci.sh, RUN_RV64_dhrystone.sh etc) have CRLF line teminators, when they shouldn't. Using dos2unix sorts this out, but it would be best to not have to do this!

duncangraham-Imperas commented 1 year ago

I have just checked the source of these files before they were uploaded and they do not have CRLF line terminators; so I do not know why you are seeing this. Below I am showing the result of the file and od commands on the shell and batch files that were uploaded.

 github $ file ./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.sh 
./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.sh: Bourne-Again shell script, ASCII text executable
github $ od -c ./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.sh
0000000   #   !   /   b   i   n   /   b   a   s   h  \n  \n   c   d    
<snip>
0000340           "   $   @   "  \n

Only the batch files have this

github $ file ./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.bat 
./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.bat: DOS batch file, ASCII text, with CRLF line terminators
github $ od -c ./imperas-riscv-tests/riscv-ovpsim/examples/fibonacci/RUN_RV32_fibonacci.bat
0000000   @   e   c   h   o       o   f   f  \r  \n  \r  \n   ;   r   e
<snip>
0000440       p   a   u   s   e       )  \r  \n
0000452
CBindahouse commented 1 year ago

That's strange. I used git clone and downloaded the zip directly from Github and got the same results.

~/imperas-riscv-tests/riscv-ovpsim/examples/fibonacci$ file ./RUN_RV64_fibonacci.sh
./RUN_RV64_fibonacci.sh: Bourne-Again shell script, ASCII text executable, with CRLF line terminators