I am battling to run a shell script which has 3 scripts which it needs to call and execute one after each other as soon as the execution completes successfully (error:

gzip:.gz: unexpected end of file


The problem I have is that my first script decompresses gzip files using gunzip. But when this is run via my main script, it does not execute completely, and goes to the next script.

Below is the main shell script:


This is what the gunzip_files shell script looks like:

sudo gunzip *.gz

1 Answer 1


I think you should try this :

./gunzip_files.sh & &  ./grep_data_from_files.sh

It execute the second script only if the first exited with no errors.

  • Got an error with this as well using command: ./gunzipper_test022.sh && ./extract_test022.sh error: gzip: filname_009.gz: unexpected end of file
    – NinjaLoop
    Feb 26, 2015 at 11:41
  • Can you try without the && ./grep_data_from_files.sh, because I would say that the ./gunzip_files.sh does not work at all Feb 26, 2015 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .