(command.CommandList children: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:vers) op:Equal rhs:{(1.4)})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_RBracket ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Usage: amuFormat.sh <Card Type> <drive>'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Simple words: [{(echo)} {(DQ ('<Card Type> has to be defined in amuFormat.sh itself'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.Simple words: [{(echo)} {(DQ ('<drive> has to be defined in mtools.conf'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) (C {(echo)} {(DQ ('amuFormat ') ($ VSub_DollarName '$vers') (' started...'))}) (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:drive) op:Equal rhs:{(DQ ($ VSub_Number '$2'))})] ) (command.Case to_match: {(DQ ($ VSub_Number '$1'))} arms: [ (case_arm pat_list: [{(8MBCARD-FW)}] action: [ (command.Case to_match: {(DQ ($ VSub_Number '$2'))} arms: [ (case_arm pat_list: [{(Lit_LBracket '[') (bB) (Lit_RBracket ']') (Lit_Other ':')}] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:drive) op:Equal rhs:{(DQ ('f:'))})] ) ] ) (case_arm pat_list: [{(Lit_LBracket '[') (cC) (Lit_RBracket ']') (Lit_Other ':')}] action: [ (command.Assignment pairs: [(assign_pair lhs:(lhs_expr.LhsName name:drive) op:Equal rhs:{(DQ ('g:'))})] ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (command.Sentence child: (C {(echo)} {(DQ ('Drive ') ($ VSub_Number '$2') (' not supported.'))}) terminator: <Op_Semi ';'> ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) ] ) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cylinders) op: Equal rhs: {(245)} ) (assign_pair lhs:(lhs_expr.LhsName name:heads) op:Equal rhs:{(2)}) (assign_pair lhs: (lhs_expr.LhsName name:cluster_size) op: Equal rhs: {(8)} ) ] ) ] ) (case_arm pat_list: [{(32MBCARD-FW)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cylinders) op: Equal rhs: {(489)} ) (assign_pair lhs:(lhs_expr.LhsName name:heads) op:Equal rhs:{(4)}) (assign_pair lhs: (lhs_expr.LhsName name:cluster_size) op: Equal rhs: {(4)} ) ] ) ] ) (case_arm pat_list: [{(64MBCARD-FW)}] action: [ (C {(echo)} {(DQ ('***** WARNING: untested on AvHMU, exiting *****'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cylinders) op: Equal rhs: {(245)} ) (assign_pair lhs:(lhs_expr.LhsName name:heads) op:Equal rhs:{(2)}) (assign_pair lhs: (lhs_expr.LhsName name:cluster_size) op: Equal rhs: {(8)} ) ] ) ] ) (case_arm pat_list: [{(1GBCARD-FW)}] action: [ (C {(echo)} {(DQ ('***** WARNING: untested on AvHMU *****'))}) (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cylinders) op: Equal rhs: {(2327)} ) (assign_pair lhs:(lhs_expr.LhsName name:heads) op:Equal rhs:{(16)}) (assign_pair lhs: (lhs_expr.LhsName name:cluster_size) op: Equal rhs: {(64)} ) ] ) ] ) (case_arm pat_list: [{(64MBCARDSAN)}] action: [ (command.Assignment pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:cylinders) op: Equal rhs: {(489)} ) (assign_pair lhs:(lhs_expr.LhsName name:heads) op:Equal rhs:{(8)}) (assign_pair lhs: (lhs_expr.LhsName name:cluster_size) op: Equal rhs: {(4)} ) ] ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [ (C {(echo)} {(DQ ('Card not supported.'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) (C {(echo)} {(DQ ('Formatting card in slot ') ($ VSub_Number '$2') (' as ') ($ VSub_Number '$1'))}) (C {(mpartition)} {(-I)} {(DQ ($ VSub_DollarName '$drive'))}) (C {(mpartition)} {(-c)} {(-t) ($ VSub_DollarName '$cylinders')} {(-h) ($ VSub_DollarName '$heads')} {(-s32)} {(-b32)} {(DQ ($ VSub_DollarName '$drive'))} ) (C {(mformat)} {(-c) ($ VSub_DollarName '$cluster_size')} {(-v)} {(DQ ($ VSub_Number '$1'))} {(DQ ($ VSub_DollarName '$drive'))} ) (C {(minfo)} {(DQ ($ VSub_Number '$2'))}) (C {(mdir)} {(DQ ($ VSub_Number '$2'))}) (C {(echo)} {(DQ (done.))}) ] )