(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:retries) op:Equal rhs:{(DQ (10))} spids:[7])] spids: [7] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:action) op:Equal rhs:{(DQ (lock))} spids:[15])] spids: [15] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nullcmd) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(which)} {(true)})]) left_token: <Left_Backtick '`'> spids: [25 29] ) ) } spids: [23] ) ] spids: [23] ) (WhileUntil keyword: <KW_While while> cond: [(Sentence child:(C {(getopts)} {(DQ ('lur:'))} {(opt)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (Case to_match: {($ VSub_Name '$opt')} arms: [ (case_arm pat_list: [{(l)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:action) op: Equal rhs: {(DQ (lock))} spids: [61] ) ] spids: [61] ) ] spids: [57 59 66 16777215] ) (case_arm pat_list: [{(u)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:action) op: Equal rhs: {(DQ (unlock))} spids: [73] ) ] spids: [73] ) ] spids: [69 71 78 16777215] ) (case_arm pat_list: [{(r)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:retries) op: Equal rhs: {(DQ ($ VSub_Name '$OPTARG'))} spids: [85] ) ] spids: [85] ) ] spids: [81 83 90 16777215] ) ] spids: [50 54 93] ) ] spids: [47 95] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$OPTIND')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [99 106] ) } ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-eq)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (HereDoc op: <Redir_DLess '<<'> fd: 16777215 here_begin: {(EOF)} here_end_span_id: 146 stdin_parts: [ ('Usage: ') ($ VSub_Number '$0') (' [-l|-u] [-r retries] LOCKFILE\n') ('Where -l requests a lock (the default), -u requests an unlock, -r X \n') ('specifies a max number of retries before it fails (default = ') ($ VSub_Name '$retries') (').\n') ] ) (Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)}) ] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 123] ) ] spids: [16777215 152] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(which)} {(lockfile)}) (C {(grep)} {(-v)} {(SQ <'^no '>)})] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [166 180] ) ) } {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Number '$0') (" failed: 'lockfile' utility not found in PATH."))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 187] ) ] spids: [16777215 205] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$action'))} {(Lit_Other '=')} {(DQ (lock))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(lockfile)} {(-1)} {(-r)} {($ VSub_Name '$retries')} {(DQ ($ VSub_Number '$1'))} ] redirects: [(Redir op:<Redir_Great '2>'> fd:2 arg_word:{(/dev/null)})] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ($ VSub_Number '$0') (": Failed: Couldn't create lockfile in time"))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 249] ) ] spids: [16777215 268] ) ] spids: [16777215 225] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-f)} {(DQ ($ VSub_Number '$1'))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ($ VSub_Number '$0') (': Warning: lockfile ') ($ VSub_Number '$1') (" doesn't exist to unlock") ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 292] ) ] spids: [16777215 313] ) (C {(rm)} {(-f)} {(DQ ($ VSub_Number '$1'))}) ] spids: [270 324] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)}) ] )