(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:Z) op: assign_op.Equal rhs: {(DQ (compress))} spids: [17] ) (assign_pair lhs: (sh_lhs_expr.Name name:gz) op: assign_op.Equal rhs: {(DQ (gzip))} spids: [22] ) (assign_pair lhs: (sh_lhs_expr.Name name:bz) op: assign_op.Equal rhs: {(DQ (bzip2))} spids: [27] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:Zout) op: assign_op.Equal rhs: {(DQ (/tmp/bestcompress.) ($ Id.VSub_Dollar '$$') (.Z))} spids: [32] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gzout) op: assign_op.Equal rhs: {(DQ (/tmp/bestcompress.) ($ Id.VSub_Dollar '$$') (.gz))} spids: [39] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:bzout) op: assign_op.Equal rhs: {(DQ (/tmp/bestcompress.) ($ Id.VSub_Dollar '$$') (.bz))} spids: [46] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:skipcompressed) op: assign_op.Equal rhs: {(1)} spids: [53] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Number '$1'))} {(Id.Lit_Equals '=')} {(DQ (-a))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:73) ) ] action: [ (command.Sentence child: (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:skipcompressed) op: assign_op.Equal rhs: {(0)} spids: [78] ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:81) ) (C {(shift)}) ] spids: [57 75] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:99) ) ] action: [ (command.Sentence child: (command.Simple words: [ {(echo)} { (DQ ('Usage: ') ($ Id.VSub_Number '$0') (' [-a] file or files to optimally compress') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:112) fd: -1 arg_word: {(2)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:114) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:116) arg_word: {(1)} ) ] spids: [88 101] ) ] ) (C {(trap)} { (DQ ('/bin/rm -f ') ($ Id.VSub_DollarName '$Zout') (' ') ($ Id.VSub_DollarName '$gzout') (' ') ($ Id.VSub_DollarName '$bzout') ) } {(EXIT)} ) (command.ForEach iter_name: name iter_words: [{(DQ ($ Id.VSub_At '$@'))}] do_arg_iter: F body: (command.DoGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-f)} {(DQ ($ Id.VSub_DollarName '$name'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:165) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ($ Id.VSub_Number '$0') (': file ') ($ Id.VSub_DollarName '$name') (' not found. Skipped.') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:180) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Continue val:continue span_id:184) ) ] spids: [151 167] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:196) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$name')}) (C {(egrep)} { (SQ (Token id: Id.Lit_Chars val: '(\\.Z$|\\.gz$|\\.bz2$)' span_id: 206 ) ) } ) ] negated: F ) ] ) ) ) } {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ )} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:219) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$skipcompressed')} {(-eq)} {(1)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:236) ) ] action: [ (C {(echo)} { (DQ ('Skipped file ') (${ Id.VSub_Name name) (": It's already compressed.") ) } ) (command.ControlFlow token: (Token id:Id.ControlFlow_Continue val:continue span_id:253) ) ] spids: [224 238] ) ] else_action: [ (C {(echo)} { (DQ ('Warning: Trying to double-compress ') ($ Id.VSub_DollarName '$name')) } ) ] ) ] spids: [191 221] ) ] ) (command.Sentence child: (command.Simple words: [{($ Id.VSub_DollarName '$Z')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:280) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$name'))} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:286) fd: -1 arg_word: {($ Id.VSub_DollarName '$Zout')} ) ] ) terminator: (Token id:Id.Op_Amp val:'&' span_id:290) ) (command.Sentence child: (command.Simple words: [{($ Id.VSub_DollarName '$gz')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:295) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$name'))} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:301) fd: -1 arg_word: {($ Id.VSub_DollarName '$gzout')} ) ] ) terminator: (Token id:Id.Op_Amp val:'&' span_id:305) ) (command.Sentence child: (command.Simple words: [{($ Id.VSub_DollarName '$bz')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:310) fd: -1 arg_word: {(DQ ($ Id.VSub_DollarName '$name'))} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:316) fd: -1 arg_word: {($ Id.VSub_DollarName '$bzout')} ) ] ) terminator: (Token id:Id.Op_Amp val:'&' span_id:320) ) (C {(wait)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:smallest) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:337) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(ls)} {(-l)} {(DQ ($ Id.VSub_DollarName '$name'))} {($ Id.VSub_DollarName '$Zout')} {($ Id.VSub_DollarName '$gzout')} {($ Id.VSub_DollarName '$bzout')} ) (C {(awk)} {(SQ (Token id:Id.Lit_Chars val:'{print $5"="NR}' span_id:359))} ) (C {(sort)} {(-n)}) (C {(cut)} {(-d) (Id.Lit_Equals '=')} {(-f2)}) (C {(head)} {(-1)}) ] negated: F ) ] ) ) ) } spids: [335] ) ] ) (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$smallest'))} arms: [ (case_arm pat_list: [{(1)}] action: [ (C {(echo)} { (DQ ('No space savings by compressing ') ($ Id.VSub_DollarName '$name') ('. Left as is.') ) } ) ] spids: [396 398 409 -1] ) (case_arm pat_list: [{(2)}] action: [ (C {(echo)} {(Best)} {(compression)} {(is)} {(with)} {(compress.)} {(File)} {(renamed)} {(${ Id.VSub_Name name) (.Z)} ) (command.Sentence child: (C {(mv)} {($ Id.VSub_DollarName '$Zout')} {(DQ (${ Id.VSub_Name name) (.Z))}) terminator: (Token id:Id.Op_Semi val:';' span_id:449) ) (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$name'))}) ] spids: [412 414 460 -1] ) (case_arm pat_list: [{(3)}] action: [ (C {(echo)} {(Best)} {(compression)} {(is)} {(with)} {(gzip.)} {(File)} {(renamed)} {(${ Id.VSub_Name name) (.gz)} ) (command.Sentence child: (C {(mv)} {($ Id.VSub_DollarName '$gzout')} {(DQ (${ Id.VSub_Name name) (.gz))}) terminator: (Token id:Id.Op_Semi val:';' span_id:500) ) (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$name'))}) ] spids: [463 465 511 -1] ) (case_arm pat_list: [{(4)}] action: [ (C {(echo)} {(Best)} {(compression)} {(is)} {(with)} {(bzip2.)} {(File)} {(renamed)} {(${ Id.VSub_Name name) (.bz2)} ) (command.Sentence child: (C {(mv)} {($ Id.VSub_DollarName '$bzout')} {(DQ (${ Id.VSub_Name name) (.bz2))}) terminator: (Token id:Id.Op_Semi val:';' span_id:551) ) (C {(rm)} {(-f)} {(DQ ($ Id.VSub_DollarName '$name'))}) ] spids: [514 516 -1 562] ) ] ) ] ) ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:568) arg_word:{(0)}) ] )