(CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:homedir) op:Equal rhs:{(DQ (/home))} spids:[11])] spids: [11] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pwfile) op:Equal rhs:{(DQ (/etc/passwd))} spids:[16])] spids: [16] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:shadow) op:Equal rhs:{(DQ (/etc/shadow))} spids:[22])] spids: [22] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newpwfile) op: Equal rhs: {(DQ (/etc/passwd.new))} spids: [27] ) ] spids: [27] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:newshadow) op: Equal rhs: {(DQ (/etc/shadow.new))} spids: [33] ) ] spids: [33] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:locker) op: Equal rhs: {(DQ (/etc/passwd.lock))} spids: [38] ) ] spids: [38] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} {($ VSub_Number '$1')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (SimpleCommand words: [{(echo)} {(DQ ('Usage: ') ($ VSub_Number '$0') (' account'))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[67])] ) terminator: <Op_Semi ';'> ) (C {(exit)} {(1)}) ] spids: [-1 56] ) (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(whoami)})]) left_token: <Left_CommandSub '$('> spids: [80 82] ) ) } {(KW_Bang '!') (Lit_Other '=')} {(DQ (root))} {(Lit_Other ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (SimpleCommand words: [{(echo)} {(DQ ("Error: you must be 'root' to run this command."))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[104])] ) terminator: <Op_Semi ';'> ) (C {(exit)} {(1)}) ] spids: [75 96] ) ] spids: [-1 112] ) (C {(suspenduser)} {($ VSub_Number '$1')}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:uid) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(grep)} {(-E)} {(DQ ('^') (${ VSub_Number 1) (':'))} {($ VSub_Name '$pwfile')} ) (C {(cut)} {(-d) (Lit_Other ':')} {(-f3)}) ] negated: False ) ] ) left_token: <Left_CommandSub '$('> spids: [125 148] ) ) } spids: [123] ) ] spids: [123] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(-z)} {($ VSub_Name '$uid')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (SimpleCommand words: [ {(echo)} { (DQ ('Error: no account ') ($ VSub_Number '$1') (' found in ') ($ VSub_Name '$pwfile') ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[176])] ) terminator: <Op_Semi ';'> ) (C {(exit)} {(1)}) ] spids: [-1 164] ) ] spids: [-1 184] ) (SimpleCommand words: [{(grep)} {(-vE)} {(DQ ('^') (${ VSub_Number 1) (':'))} {($ VSub_Name '$pwfile')}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name '$newpwfile')} spids:[204])] ) (SimpleCommand words: [{(grep)} {(-vE)} {(DQ ('^') (${ VSub_Number 1) (':'))} {($ VSub_Name '$shadow')}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{($ VSub_Name '$newshadow')} spids:[222])] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:lockcmd) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(which)} {(lockfile)})]) left_token: <Left_CommandSub '$('> spids: [229 233] ) ) } spids: [227] ) ] spids: [227] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {(KW_Bang '!')} {(-z)} {($ VSub_Name '$lockcmd')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(eval)} {($ VSub_Name '$lockcmd')} {(-r)} {(15)} {($ VSub_Name '$locker')})] spids: [-1 253] ) ] else_action: [ (While cond: [ (Sentence child: (C {(Lit_Other '[')} {(-e)} {($ VSub_Name '$locker')} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] body: (DoGroup children: [ (Sentence child: (C {(echo)} {(DQ ('waiting for the password file'))}) terminator: <Op_Semi ';'> ) (C {(sleep)} {(1)}) ] spids: [288 304] ) ) (C {(touch)} {($ VSub_Name '$locker')}) ] spids: [270 314] ) (C {(mv)} {($ VSub_Name '$newpwfile')} {($ VSub_Name '$pwfile')}) (C {(mv)} {($ VSub_Name '$newshadow')} {($ VSub_Name '$shadow')}) (C {(rm)} {(-f)} {($ VSub_Name '$locker')}) (C {(chmod)} {(644)} {($ VSub_Name '$pwfile')}) (C {(chmod)} {(400)} {($ VSub_Name '$shadow')}) (C {(rm)} {(-rf)} {($ VSub_Name '$homedir') (/) ($ VSub_Number '$1')}) (C {(echo)} {(DQ ('Files still left to remove (if any):'))}) (Pipeline children: [ (SimpleCommand words: [{(find)} {(/)} {(-uid)} {($ VSub_Name '$uid')} {(-print)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[382])] ) (C {(sed)} {(SQ <'s/^/ /'>)}) ] negated: False ) (C {(echo)} {(DQ )}) (C {(echo)} { (DQ ('Account ') ($ VSub_Number '$1') (' (uid ') ($ VSub_Name '$uid') (') has been deleted, and their home directory ') ) } ) (C {(echo)} {(DQ ('(') ($ VSub_Name '$homedir') (/) ($ VSub_Number '$1') (') has been removed.'))}) (C {(exit)} {(0)}) ] )