(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: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ (command_sub left_token:<Id.Left_DollarParen '$('> child:(C {<id>} {<-nu>})))} {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ <root>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<echo>} {(DQ ($ Id.VSub_Number '$0') <': Error: You must be root to run this command.'>)} ] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [28 51] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<grep>} {(SQ <'^nobody:'>)} {<'/etc/passwd'>}) ) ) } {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<echo>} { (DQ ($ Id.VSub_Number '$0') <': Error: you must have an account for user \'nobody\''> ) } ] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) (command.Sentence child: (command.Simple words: [{<echo>} {(DQ <'to create the default slocate database.'>)}] redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) ] spids: [72 97] ) ] ) (C {<cd>} {<'/'>}) (command.Simple words: [{<su>} {<-fm>} {<nobody>} {<-c>} {(DQ <'find / -print'>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName '$locatedb')} ) (redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>}) ] do_fork: T ) (C {<echo>} {(DQ <'building default slocate database (user = nobody)'>)}) (C {<echo>} {<Id.Lit_TDot ...>} {<result>} {<is>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<wc>} {<-l>}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {($ Id.VSub_DollarName '$locatedb')} ) ] do_fork: T ) ) } {<lines>} {<long.>} ) (command.ForEach iter_name: account iter_words: [ { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<cut>} {<-d> <Id.Lit_Colon ':'>} {<-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: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<grep>} {(DQ <'^'> (${ Id.VSub_Name account) <':'>)} {<'/etc/passwd'>} ) (C {<cut>} {<-d> <Id.Lit_Colon ':'>} {<-f6>}) ] negated: F ) ) ) } spids: [213] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$homedir'))} {<Id.Lit_Equals '='>} {(DQ <'/'>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(command.ControlFlow token:<Id.ControlFlow_Continue continue>)] spids: [241 259] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-e>} {($ Id.VSub_DollarName '$homedir') <'/'> ($ Id.VSub_DollarName '$slocatedb') } {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) 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 op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName '$homedir') <'/'> ($ Id.VSub_DollarName '$slocatedb') } ) (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] do_fork: T ) (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>} {<Id.Lit_TDot ...>} {<result>} {<is>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<wc>} {<-l>}] redirects: [ (redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {($ Id.VSub_DollarName '$homedir') <'/'> ($ Id.VSub_DollarName '$slocatedb') } ) ] do_fork: T ) ) } {<lines>} {<long.>} ) ] spids: [268 282] ) ] ) ] ) ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )