(command.CommandList children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:currentVersion) op: assign_op.Equal rhs: {(DQ (1.11.1))} spids: [6] ) ] ) (C {(declare)} {(-a)} {(Id.Lit_VarLike 'tools=') (sh_array_literal left: (Token id:Id.Op_LParen val:'(' span_id:16) words: [ {(currency)} {(stocks)} {(weather)} {(crypt)} {(movies)} {(taste)} {(short)} {(geo)} {(cheat)} {(ytview)} {(cloudup)} {(qrify)} ] ) } ) (command.ShFunction name: askInstall body: (command.BraceGroup children: [ (C {(echo)} {(-n)} {(DQ ('Do you wish to install ') ($ Id.VSub_Number '$1') (' [Y/n]: '))}) (C {(read)} {(-r)} {(answer)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.LogicalOr left: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$answer'))} right: {(DQ (Y))} ) right: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {(DQ ($ Id.VSub_DollarName '$answer'))} right: {(DQ (y))} ) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:96) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {($ Id.VSub_Number '$1')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:106) arg_word: {(1)} ) ] ) (C {(echo)} {(-n)} {(DQ ('Installing ') ($ Id.VSub_Number '$1') (': '))}) (C {(chmod)} {(a) (Id.Lit_Other '+') (x)} {($ Id.VSub_Number '$1')}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cp)} {($ Id.VSub_Number '$1')} {(/usr/local/bin)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:137) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:141) fd: 2 arg_word: {(1)} ) ] ) (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(DQ (Failure))}) terminator: (Token id:Id.Op_Semi val:';' span_id:153) ) (command.Sentence child: (C {(echo)} {(DQ ('Error copying file, try running install script as sudo'))} ) terminator: (Token id:Id.Op_Semi val:';' span_id:160) ) (command.Sentence child: (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:162) arg_word: {(1)} ) terminator: (Token id:Id.Op_Semi val:';' span_id:165) ) ] ) ] ) (C {(echo)} {(DQ (Success))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {(..)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:183) arg_word: {(1)} ) ] ) ] spids: [68 97] ) ] ) ] ) ) (command.ShFunction name: updateTool body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Unary op_id: Id.BoolUnary_f child: {(/usr/local/bin/) ($ Id.VSub_Number '$1')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:210) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {($ Id.VSub_Number '$1')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:220) arg_word: {(1)} ) ] ) (C {(echo)} {(-n)} {(DQ ('Installing ') ($ Id.VSub_Number '$1') (': '))}) (C {(chmod)} {(a) (Id.Lit_Other '+') (x)} {($ Id.VSub_Number '$1')}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cp)} {($ Id.VSub_Number '$1')} {(/usr/local/bin)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:251) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:255) fd: 2 arg_word: {(1)} ) ] ) (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(DQ (Failure))}) terminator: (Token id:Id.Op_Semi val:';' span_id:267) ) (command.Sentence child: (C {(echo)} {(DQ ('Error copying file, try running install script as sudo'))} ) terminator: (Token id:Id.Op_Semi val:';' span_id:274) ) (command.Sentence child: (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:276) arg_word: {(1)} ) terminator: (Token id:Id.Op_Semi val:';' span_id:279) ) ] ) ] ) (C {(echo)} {(DQ (Success))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {(..)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:297) arg_word: {(1)} ) ] ) ] spids: [200 211] ) ] ) ] ) ) (command.ShFunction name: singleInstall body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {($ Id.VSub_Number '$1')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:320) arg_word: {(1)} ) ] ) (C {(echo)} {(-n)} {(DQ ('Installing ') ($ Id.VSub_Number '$1') (': '))}) (C {(chmod)} {(a) (Id.Lit_Other '+') (x)} {($ Id.VSub_Number '$1')}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cp)} {($ Id.VSub_Number '$1')} {(/usr/local/bin)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:351) fd: -1 arg_word: {(/dev/null)} ) (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:355) fd: 2 arg_word: {(1)} ) ] ) (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(DQ (Failure))}) terminator: (Token id:Id.Op_Semi val:';' span_id:367) ) (command.Sentence child: (C {(echo)} {(DQ ('Error copying file, try running install script as sudo'))}) terminator: (Token id:Id.Op_Semi val:';' span_id:374) ) (command.Sentence child: (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:376) arg_word: {(1)} ) terminator: (Token id:Id.Op_Semi val:';' span_id:379) ) ] ) ] ) (C {(echo)} {(DQ (Success))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(cd)} {(..)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:397) arg_word: {(1)} ) ] ) ] ) ) (command.ShFunction name: copyManpage body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{(cp)} {(bash-snippets.1)} {(/usr/local/man/man1)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:417) fd: 2 arg_word: {(1)} ) ] ) (command.BraceGroup children: [ (command.Sentence child: (C {(echo)} {(DQ (Failure))}) terminator: (Token id:Id.Op_Semi val:';' span_id:429) ) (command.Sentence child: (C {(echo)} {(DQ ('Error copying file, try running install script as sudo'))}) terminator: (Token id:Id.Op_Semi val:';' span_id:436) ) (command.Sentence child: (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:438) arg_word: {(1)} ) terminator: (Token id:Id.Op_Semi val:';' span_id:441) ) ] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Pound '$#')} right: {(0)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:459) ) ] action: [ (command.ForEach iter_name: tool iter_words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:tools span_id:472) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(askInstall)} {($ Id.VSub_DollarName '$tool')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:489) arg_word: {(1)} ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(copyManpage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:501) arg_word: {(1)} ) ] ) ] spids: [448 461] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number '$1')} right: {(DQ (update))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:518) ) ] action: [ (C {(echo)} {(DQ ('Updating scripts...'))}) (command.ForEach iter_name: tool iter_words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:tools span_id:538) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(updateTool)} {($ Id.VSub_DollarName '$tool')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:555) arg_word: {(1)} ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(copyManpage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:567) arg_word: {(1)} ) ] ) ] spids: [505 520] ) (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number '$1')} right: {(DQ (all))} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:584) ) ] action: [ (command.ForEach iter_name: tool iter_words: [ { (DQ (braced_var_sub token: (Token id:Id.VSub_Name val:tools span_id:596) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(singleInstall)} {($ Id.VSub_DollarName '$tool')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:613) arg_word: {(1)} ) ] ) ] ) ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(copyManpage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:625) arg_word: {(1)} ) ] ) ] spids: [571 585] ) ] else_action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(singleInstall)} {($ Id.VSub_Number '$1')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:638) arg_word: {(1)} ) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {(copyManpage)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:647) arg_word: {(1)} ) ] ) ] ) (C {(echo)} {(-n)} {(DQ ('( \xe2\x80\xa2_\xe2\x80\xa2)'))}) (C {(sleep)} {(.75)}) (C {(echo)} {(-n)} {(-e)} { (DQ (Id.Lit_Other '\\') ('r( \xe2\x80\xa2_\xe2\x80\xa2)>\xe2\x8c\x90\xe2\x96\xa0-\xe2\x96\xa0') ) } ) (C {(sleep)} {(.75)}) (C {(echo)} {(-n)} {(-e)} {(DQ (Id.Lit_Other '\\') ('r '))}) (C {(echo)} {(-e)} {(DQ (Id.Lit_Other '\\') ('r(\xe2\x8c\x90\xe2\x96\xa0_\xe2\x96\xa0)'))}) (C {(sleep)} {(.5)}) (C {(echo)} {(DQ ('Bash Snippets version ') ($ Id.VSub_DollarName '$currentVersion'))}) (C {(echo)} {(DQ ('https://github.com/alexanderepstein/Bash-Snippets'))}) ] )