fgrep files and insert characters before & after the output

I’m preparing a Unix shell script to scan backup log and to check for failure code.

If the directory backup is finished with failure, then the script must be able to pick-up the failed directory and write to an include file for re-submit later.

The backup log should have showing following result:

Backup processing of '/fscm/ldata/91/*' finished without failure.
Backup processing of '/fscm/ldata/92/*' finished without failure.
Backup processing of '/fscm/ldata/93/*' finished without failure.
Backup processing of '/fscm/ldata/94/*' finished without failure.
Backup processing of '/fscm/ldata/95/*' finished without failure.

What if some directories were failed to backup?

Backup processing of '/fscm/ldata/97/*' finished with failure.
Backup processing of '/fscm/ldata/98/*' finished with failure.

Read more »

Popularity: 32% [?]