AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only
Expand all | Collapse all

Handle compress command error messages

  • 1.  Handle compress command error messages

    Posted Mon March 02, 2015 07:44 AM

    Originally posted by: nvarun


    I am working on production issue and unable to reproduce error message for compress command.

    Current Solution

    We have case-esac block in shell wrapper that handles messages as follows;

    
    
    case 
    "$MSG" 
    in 
     "This file is not changed; compression does not save space."
    ) 
        echo 
    "$MSG"  
    ;;  
     *
    unchanged
    *) 
        echo 
    "$MSG" 
          
     ;;  
    *) 
        echo ERROR       
     ;;
    esac
    

    Problem Scenario

    The compress command when called through wrapper (for some files) produces error message (let say, Type 1);

    
    
    -- 
    file unchanged
    

    However, executing the same command (for same set of files) on command line produces different error message (let say, Type 2);

    
    
    This 
    file is not changed
    ; 
    compression does not save space
    .
    

    Can someone help me understand this behavior? If possible, suggest reproducing Type 1 error message.

     


    #AIX-Forum


  • 2.  Re: Handle compress command error messages

    Posted Mon March 09, 2015 10:40 AM

    Originally posted by: Wouter Liefting


    It might just be me, but it looks like your case/esac block is badly formatted and has two default stanzas included.

     

    Try looking up the manual page for case/esac (part of the ksh manual page) and check out a few internet examples to see what a proper statement should look like.


    #AIX-Forum