"bash -c" on Windows 10 and command not working due to quotes

269 Views Asked by At

I need to split a *.zst file into multiple smaller *.gz files using a Bash command that works in Windows cmd (using cmder):

bash

Then when Linux mode runs:

unzstd --long=31 -c /mnt/c/file.zst | split -C 200000000 -d -a4 - file-chunk --filter='gzip > /mnt/c/$FILE.gz'

However I need to run it as part of a cmd script, so my solution is to use bash -c to run it from within Windows cmd :

(some cmd Windows based) 
& (bash -c "unzstd --long=31 -c /mnt/c/file.zst | split -C 200000000 -d -a4 - file-chunk --filter='gzip > /mnt/c/$FILE.gz'")
& (some cmd Windows based) 

But this does not work : even if I don't get any error, an empty ".gz" file with no name is created in the folder and that's it.

I think something unexpected happens with the single / double quotes, but not sure what to do. I tried to escape them with 'backslashes \ ' but nothing worked.

0

There are 0 best solutions below