BestSolution-at / fixtar

extract data from corrupted tar files
GNU General Public License v2.0
42 stars 9 forks source link

test script fails to work in dash #3

Closed nyov closed 8 years ago

nyov commented 8 years ago

./test/testing fails to work in dash:

$ ./testing 
1+0 records in
1+0 records out
1023 bytes (1.0 kB) copied, 0.002233 s, 458 kB/s
3+0 records in
3+0 records out
7071 bytes (7.1 kB) copied, 6.2438e-05 s, 113 MB/s
LONG LABEL :: 2016-02-12
ERROR: unexpected end of file at "abc/tar2.txt", fillup with newlines
abc/
abc/
abc/tar.txt
abc/tar2.txt
./testing: 13: test: 0: unexpected operator
ERROR

Expected output (using bash):

$ ./testing 
1+0 records in
1+0 records out
1023 bytes (1.0 kB) copied, 0.00189486 s, 540 kB/s
3+0 records in
3+0 records out
23397 bytes (23 kB) copied, 0.000112276 s, 208 MB/s
LONG LABEL :: 2016-02-12
ERROR: unexpected end of file at "abc/tar2.txt", fillup with newlines
abc/
abc/
abc/tar.txt
abc/tar2.txt
»ERROR: unexpected end of file at "abc/tar2.txt", fillup with newlines« <-- this line was expected
LONG LABEL :: 2016-02-12
abc/
abc/
abc/tar.txt
abc/tar2.txt
test: ok

Solution: set interpreter to #!/bin/bash

nyov commented 8 years ago

Thanks!