(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: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '$#')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Sentence child: (command.Simple words: [ {<echo>} { (DQ <'Usage: '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) <' [file or files to sync]'> ) } ] 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: [28 42] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<ps>} {<-ef>}) (C {<grep>} {(DQ ($ Id.VSub_DollarName '$gapp'))}) (C {<grep>} {<-v>} {<grep>}) ] negated: F ) ) ) } {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) 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: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {(DQ ($ Id.VSub_DollarName '$gsync'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<mkdir>} {(DQ ($ Id.VSub_DollarName '$gsync'))}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_QMark '$?')} {<-ne>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Simple words: [ {<echo>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$0')}) ) <': Failed trying to mkdir '> ($ Id.VSub_DollarName '$gsync') ) } ] 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: [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:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )