(command.CommandList children: [ (command.Simple blame_tok: <set> more_env: [] words: [{<set>} {<-o>} {<nounset>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <set> more_env: [] words: [{<set>} {<-o>} {<pipefail>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <set> more_env: [] words: [{<set>} {<-o>} {<errexit>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <readonly> more_env: [] words: [ {<readonly>} {<Id.Lit_VarLike 'FILES='> (ShArrayLiteral left: <Id.Op_LParen _> words: [ {<'../'> <Id.Lit_Star '*'> <.sh>} {<'../'> <Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.sh>} {<'../'> <Id.Lit_Star '*'> <.py>} {<'../'> <Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>} {<'../'> <Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <'/'> <Id.Lit_Star '*'> <.py>} ] right: <Id.Right_ShArrayLiteral _> ) } ] redirects: [] do_fork: T ) (command.ShFunction name_tok: <test-awk> name: test-awk body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ForEach keyword: <Id.KW_For for> iter_names: [awk] iterable: (for_iter.Words words: [ {<gawk>} {<mawk>} {(word_part.TildeSub token:<Id.Lit_TildeLike '~'>) <'/git/bwk/bwk'>} ] ) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {<--->}] redirects: [] do_fork: T ) (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {($ Id.VSub_DollarName awk)}] redirects: [] do_fork: T ) (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {<--->}] redirects: [] do_fork: T ) (command.TimeBlock keyword: <Id.KW_Time time> pipeline: (command.ForEach keyword: <Id.KW_For for> iter_names: [i] iterable: (for_iter.Words words: [ (word.BracedTree parts: [ (word_part.BracedRange blame_tok: <1..10> kind: Id.Range_Int start: 1 end: 10 step: 1 ) ] ) ] ) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <Id.VSub_DollarName '$awk'> more_env: [] words: [ {($ Id.VSub_DollarName awk)} { (SQ <'\n'> <' { \n'> <' line = tolower($0)\n'> <' num_lines += 1\n'> <'\n'> <' # NOTE: gawk has length(); mawk does not\n'> <' if (!(line in unique)) {\n'> <' num_unique += 1\n'> <' }\n'> <' unique[line] += 1\n'> <' }\n'> <' END {\n'> <' print "unique lines: " num_unique\n'> <' print "total lines: " num_lines\n'> <' }\n'> <' '> ) } { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILES> var_name: FILES bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) ) ] right: <Id.KW_Done done> ) redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <test-python> name: test-python body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.TimeBlock keyword: <Id.KW_Time time> pipeline: (command.ForEach keyword: <Id.KW_For for> iter_names: [i] iterable: (for_iter.Words words: [ (word.BracedTree parts: [ (word_part.BracedRange blame_tok: <1..10> kind: Id.Range_Int start: 1 end: 10 step: 1 ) ] ) ] ) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <python> more_env: [] words: [ {<python>} {<-S>} {<-c>} { (SQ <'\n'> <'import collections\n'> <'import sys\n'> <'\n'> <'num_lines = 0\n'> <'num_unique = 0\n'> <'unique = collections.defaultdict(int)\n'> <'\n'> <'for path in sys.argv[1:]:\n'> <' with open(path) as f:\n'> <' for line in f:\n'> <' line = line.lower()\n'> <' num_lines += 1\n'> <'\n'> <' if line not in unique:\n'> <' num_unique += 1\n'> <' unique[line] += 1\n'> <'\n'> <'print "unique lines: ", num_unique\n'> <'print "total lines: ", num_lines\n'> <' '> ) } { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILES> var_name: FILES bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <test-wc> name: test-wc body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.TimeBlock keyword: <Id.KW_Time time> pipeline: (command.ForEach keyword: <Id.KW_For for> iter_names: [i] iterable: (for_iter.Words words: [ (word.BracedTree parts: [ (word_part.BracedRange blame_tok: <1..10> kind: Id.Range_Int start: 1 end: 10 step: 1 ) ] ) ] ) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <cat> more_env: [] words: [ {<cat>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILES> var_name: FILES bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <wc> more_env: [] words: [{<wc>} {<-c>}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] right: <Id.KW_Done done> ) redirects: [] ) ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <files> name: files body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <echo> more_env: [] words: [ {<echo>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILES> var_name: FILES bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <echo> more_env: [] words: [ {<echo>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name FILES> var_name: FILES prefix_op: <Id.VSub_Pound '#'> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) <' files'> ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Simple blame_tok: <Id.Left_DoubleQuote '"'> more_env: [] words: [{(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) ] )