(CommandList children: [ (FuncDef name: usage body: (BraceGroup children: [ (SimpleCommand words: [ {(echo)} { (DQ ('Usage: ') (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number '$0')})]) left_token: <Left_CommandSub '$('> spids: [56 60] ) (' file|device string') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[64])] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [49] ) spids: [45 48] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:COLUMNS) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(tput)} {(cols)})]) left_token: <Left_CommandSub '$('> spids: [76 80] ) } spids: [75] ) ] spids: [75] ) (FuncDef name: progress body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DONE) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$COLUMNS')}) right: (ArithWord w:{(Lit_Digits 2)}) ) right: (ArithWord w:{($ VSub_Number '$1')}) ) right: (ArithWord w:{(Lit_Digits 100)}) ) spids: [94 109] ) } spids: [93] ) ] spids: [93] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TODO) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Minus left: (ArithWord w:{($ VSub_Name '$COLUMNS')}) right: (ArithWord w:{(Lit_Digits 2)}) ) right: (ArithWord w:{($ VSub_Name '$DONE')}) ) spids: [113 120] ) } spids: [112] ) ] spids: [112] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DONE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(printf)} {(DQ ('%') (${ VSub_Name DONE) (s))}) (C {(tr)} {(SQ <' '>)} {(Lit_Other '=')}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [124 144] ) } spids: [123] ) ] spids: [123] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TODO) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(printf)} {(DQ ('%') (${ VSub_Name TODO) (s))}) (C {(tr)} {(SQ <' '>)} {(-)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [148 168] ) } spids: [147] ) ] spids: [147] ) (SimpleCommand words: [ {(printf)} {(DQ ('[') ($ VSub_Name '$DONE') ($ VSub_Name '$TODO') (']') (Lit_Other '\\') (r))} ] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/tty)} spids:[182])] ) ] spids: [90] ) spids: [86 89] ) (FuncDef name: print body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CLEAR) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(printf)} {(DQ ('%') (${ VSub_Name COLUMNS) (s))})] ) left_token: <Left_CommandSub '$('> spids: [200 210] ) } spids: [199] ) ] spids: [199] ) (C {(printf)} {(DQ ($ VSub_Name '$CLEAR') (Lit_Other '\\') (r))}) (C {(echo)} {(DQ ($ VSub_At '$@'))}) ] spids: [196] ) spids: [192 195] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_Other ']')}) (C {(usage)}) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:DISK) op: Equal rhs: {(DQ ($ VSub_Number '$1'))} spids: [245] ) ] spids: [245] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:STRING) op: Equal rhs: {(DQ ($ VSub_Number '$2'))} spids: [250] ) ] spids: [250] ) (C {(export)} {(Lit_VarLike 'LANG=') (C)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CHUNK_SIZE) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Star left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{(Lit_Digits 8)}) right: (ArithWord w:{(Lit_Digits 1024)}) ) right: (ArithWord w:{(Lit_Digits 1024)}) ) spids: [281 288] ) } spids: [280] ) ] spids: [280] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-b)} {(DQ ($ VSub_Name '$DISK'))} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SIZE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(/sbin/blockdev)} {(--getsize64)} {($ VSub_Name '$DISK')}) ] ) left_token: <Left_CommandSub '$('> spids: [307 313] ) } spids: [306] ) ] spids: [306] ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_QMark '$?')} ) ] ) ] spids: [16777215 303] ) ] else_action: [ (AndOr ops: [Op_DPipe] children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SIZE) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(stat)} {(--format)} {(Lit_Other '%') (s)} {(DQ ($ VSub_Name '$DISK'))}) ] ) left_token: <Left_CommandSub '$('> spids: [328 339] ) } spids: [327] ) ] spids: [327] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{($ VSub_QMark '$?')}) ] ) ] spids: [324 347] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$SIZE')} {(-eq)} {(0)} {(Lit_Other ']')}) (ControlFlow token:<ControlFlow_Exit exit>) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:CHUNKS) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Minus left: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$SIZE')}) right: (ArithWord w:{($ VSub_Name '$CHUNK_SIZE')}) ) right: (ArithWord w:{(Lit_Digits 1)}) ) right: (ArithWord w:{($ VSub_Name '$CHUNK_SIZE')}) ) spids: [364 375] ) } spids: [363] ) ] spids: [363] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:i) op:Equal rhs:{(0)} spids:[378])] spids: [378] ) (While cond: [(Sentence child:(C {(true)}) terminator:<Op_Semi ';'>)] body: (DoGroup children: [ (C {(progress)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Slash left: (ArithBinary op_id: Arith_Star left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 100)}) ) right: (ArithWord w:{($ VSub_Name '$CHUNKS')}) ) spids: [391 398] ) } ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {(DQ ($ VSub_Name '$i'))} {(-ge)} {(DQ ($ VSub_Name '$CHUNKS'))} {(Lit_Other ']')} ) (ControlFlow token:<ControlFlow_Break break>) ] ) (Pipeline children: [ (SimpleCommand words: [ {(dd)} {(Lit_VarLike 'if=') ($ VSub_Name '$DISK')} {(Lit_VarLike 'iflag=') (direct)} {(Lit_VarLike 'conv=') (noerror)} {(Lit_VarLike 'bs=') ($ VSub_Name '$CHUNK_SIZE')} {(Lit_VarLike 'count=') (1)} {(Lit_VarLike 'skip=') ($ VSub_Name '$i')} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[444])] ) (SimpleCommand words: [ {(grep)} {(--binary-files) (Lit_Other '=') (text)} {(-U)} {(-F)} {(DQ ($ VSub_Name '$STRING'))} ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [468] ) ] ) ] negated: F ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:status) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(echo)} { (BracedVarSub token: <VSub_Name PIPESTATUS> bracket_op: (WholeArray op_id:Lit_At) spids: [476 481] ) } ) ] ) left_token: <Left_CommandSub '$('> spids: [473 482] ) } spids: [472] ) ] spids: [472] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:dd_status) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$status')}) (C {(cut)} {(-f1)} {(-d)} {(SQ <' '>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [486 502] ) } spids: [485] ) ] spids: [485] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:re_status) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name '$status')}) (C {(cut)} {(-f2)} {(-d)} {(SQ <' '>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [506 522] ) } spids: [505] ) ] spids: [505] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$dd_status')} {(-ne)} {(0)} {(Lit_Other ']')}) (BraceGroup children: [ (Sentence child: (SimpleCommand words: [{(echo)} {(DQ ('dd error'))}] redirects: [ (Redir op_id: Redir_GreatAnd fd: 16777215 arg_word: {(2)} spids: [545] ) ] ) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {($ VSub_Name '$dd_status')} ) terminator: <Op_Semi ';'> ) ] spids: [537] ) ] ) (AndOr ops: [Op_DAmp] children: [ (C {(Lit_Other '[')} {($ VSub_Name '$re_status')} {(-eq)} {(0)} {(Lit_Other ']')}) (BraceGroup children: [ (Sentence child: (C {(print)} { (DQ ('dd if=') ($ VSub_Name '$DISK') (' iflag=direct bs=') ($ VSub_Name '$CHUNK_SIZE') (' count=1 skip=') ($ VSub_Name '$i') (' > disk_grep.') ($ VSub_Name '$i') ) } ) terminator: <Op_Semi ';'> ) ] spids: [569] ) ] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:i) op: Equal rhs: { (ArithSubPart anode: (ArithBinary op_id: Arith_Plus left: (ArithWord w:{($ VSub_Name '$i')}) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [589 594] ) } spids: [588] ) ] spids: [588] ) ] spids: [386 596] ) ) (C {(echo)}) ] )