0

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:

#!/bin/bash
./gunzip_files.sh
./grep_data_from_files.sh

This is what the gunzip_files shell script looks like:

#!/bin/bash
sudo gunzip *.gz
0

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 '15 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 – Corentin Peuvrel Feb 26 '15 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.