(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gdrive) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$HOME') ('/Google Drive'))} spids: [10] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gsync) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName '$gdrive') (/gsync))} spids: [16] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:gapp) op: assign_op.Equal rhs: {(DQ ('Google Drive.app'))} spids: [22] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_Pound '$#')} {(-eq)} {(0)} {(Id.Lit_RBracket ']')}) terminator: (Token id:Id.Op_Semi val:';' span_id:40) ) ] action: [ (command.Sentence child: (command.Simple words: [ {(echo)} { (DQ ('Usage: ') (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:49) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_Number '$0')})] ) ) (' [file or files to sync]') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:57) fd: -1 arg_word: {(2)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:60) ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:62) arg_word: {(1)} ) ] spids: [28 42] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(-z)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:79) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(ps)} {(-ef)}) (C {(grep)} {(DQ ($ Id.VSub_DollarName '$gapp'))}) (C {(grep)} {(-v)} {(grep)}) ] negated: F ) ] ) ) ) } {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:104) ) ] action: [ (C {(echo)} {(DQ ('Starting up Google Drive daemon...'))}) (C {(open)} {(-a)} {(DQ ($ Id.VSub_DollarName '$gapp'))}) ] spids: [72 106] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(-d)} {(DQ ($ Id.VSub_DollarName '$gsync'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:144) ) ] action: [ (C {(mkdir)} {(DQ ($ Id.VSub_DollarName '$gsync'))}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_QMark '$?')} {(-ne)} {(0)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:168) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:176) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_Number '$0')})] ) ) (': Failed trying to mkdir ') ($ Id.VSub_DollarName '$gsync') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:185) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:189) arg_word: {(1)} ) ] spids: [156 170] ) ] ) ] spids: [130 146] ) ] ) (command.ForEach iter_name: name do_arg_iter: T body: (command.DoGroup children: [ (C {(echo)} {(DQ ('Copying file ') ($ Id.VSub_DollarName '$name') (' to your Google Drive'))} ) (C {(cp)} {(-a)} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ ($ Id.VSub_DollarName '$gdrive') (/gsync/))} ) ] ) ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:232) arg_word:{(0)}) ] )