(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:locatedb) op: assign_op.Equal rhs: {(DQ (/var/locate.db))} spids: [17] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:slocatedb) op: assign_op.Equal rhs: {(DQ (.slocatedb))} spids: [22] ) ] ) (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:33) command_list: (command.CommandList children:[(C {(id)} {(-nu)})]) ) ) } {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (root))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:49) ) ] action: [ (command.Simple words: [ {(echo)} {(DQ ($ Id.VSub_Number '$0') (': Error: You must be root to run this command.'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:61) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:65) arg_word: {(1)} ) ] spids: [28 51] ) ] ) (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:77) command_list: (command.CommandList children: [ (C {(grep)} {(SQ (Token id:Id.Lit_Chars val:'^nobody:' span_id:81))} {(/etc/passwd)} ) ] ) ) ) } {(Id.Lit_Equals '=')} {(DQ )} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:95) ) ] action: [ (command.Simple words: [ {(echo)} {(DQ ($ Id.VSub_Number '$0') (": Error: you must have an account for user 'nobody'"))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:107) fd: -1 arg_word: {(2)} ) ] ) (command.Sentence child: (command.Simple words: [{(echo)} {(DQ ('to create the default slocate database.'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:117) fd: -1 arg_word: {(2)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:119) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:121) arg_word: {(1)} ) ] spids: [72 97] ) ] ) (C {(cd)} {(/)}) (command.Simple words: [{(su)} {(-fm)} {(nobody)} {(-c)} {(DQ ('find / -print'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:151) fd: -1 arg_word: {($ Id.VSub_DollarName '$locatedb')} ) (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:155) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(echo)} {(DQ ('building default slocate database (user = nobody)'))}) (C {(echo)} {(...)} {(result)} {(is)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:172) command_list: (command.CommandList children: [ (command.Simple words: [{(wc)} {(-l)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:177) fd: -1 arg_word: {($ Id.VSub_DollarName '$locatedb')} ) ] ) ] ) ) } {(lines)} {(long.)} ) (command.ForEach iter_name: account iter_words: [ { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:199) command_list: (command.CommandList children: [(C {(cut)} {(-d) (Id.Lit_Other ':')} {(-f1)} {(/etc/passwd)})] ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:homedir) op: assign_op.Equal rhs: { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:215) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(grep)} {(DQ ('^') (${ Id.VSub_Name account) (':'))} {(/etc/passwd)} ) (C {(cut)} {(-d) (Id.Lit_Other ':')} {(-f6)}) ] negated: F ) ] ) ) ) } spids: [213] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$homedir'))} {(Id.Lit_Equals '=')} {(DQ (/))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:257) ) ] action: [ (command.ControlFlow token: (Token id:Id.ControlFlow_Continue val:continue span_id:262) ) ] spids: [241 259] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-e)} {($ Id.VSub_DollarName '$homedir') (/) ($ Id.VSub_DollarName '$slocatedb')} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:280) ) ] action: [ (C {(echo)} {(DQ ('building slocate database for user ') ($ Id.VSub_DollarName '$account'))} ) (command.Simple words: [ {(su)} {(-m)} {($ Id.VSub_DollarName '$account')} {(-c)} {(DQ ('find / -print'))} ] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:305) fd: -1 arg_word: {($ Id.VSub_DollarName '$homedir') (/) ($ Id.VSub_DollarName '$slocatedb')} ) (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:313) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(chmod)} {(600)} {($ Id.VSub_DollarName '$homedir') (/) ($ Id.VSub_DollarName '$slocatedb')} ) (C {(chown)} {($ Id.VSub_DollarName '$account')} {($ Id.VSub_DollarName '$homedir') (/) ($ Id.VSub_DollarName '$slocatedb')} ) (C {(echo)} {(...)} {(result)} {(is)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:343) command_list: (command.CommandList children: [ (command.Simple words: [{(wc)} {(-l)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:348) fd: -1 arg_word: {($ Id.VSub_DollarName '$homedir') (/) ($ Id.VSub_DollarName '$slocatedb') } ) ] ) ] ) ) } {(lines)} {(long.)} ) ] spids: [268 282] ) ] ) ] ) ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:365) arg_word:{(0)}) ] )