(command.CommandList children: [ (C {<Id.KW_Set set>} {<-o>} {<nounset>}) (C {<Id.KW_Set set>} {<-o>} {<pipefail>}) (C {<Id.KW_Set set>} {<-o>} {<errexit>}) (C {<readonly>} {<Id.Lit_VarLike 'FILES='> (sh_array_literal 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>} ] ) } ) (command.ShFunction name: test-awk body: (command.BraceGroup children: [ (command.ForEach iter_name: awk iter_words: [ {<gawk>} {<mawk>} {(word_part.TildeSub token:<Id.Lit_TildeLike '~'>) </git/bwk/bwk>} ] do_arg_iter: F body: (command.DoGroup children: [ (C {<echo>} {<--->}) (C {<echo>} {($ Id.VSub_DollarName '$awk')}) (C {<echo>} {<--->}) (command.TimeBlock pipeline: (command.ForEach iter_name: i iter_words: [ (word.BracedTree parts: [(word_part.BracedRange kind:Id.Range_Int start:1 end:10 step:1)] ) ] do_arg_iter: F body: (command.DoGroup children: [ (C {($ 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 (braced_var_sub token:<Id.VSub_Name FILES> bracket_op:(bracket_op.WholeArray op_id:Id.Lit_At)))} ) ] ) ) ) ] ) ) ] ) ) (command.ShFunction name: test-python body: (command.BraceGroup children: [ (command.TimeBlock pipeline: (command.ForEach iter_name: i iter_words: [ (word.BracedTree parts: [(word_part.BracedRange kind:Id.Range_Int start:1 end:10 step:1)] ) ] do_arg_iter: F body: (command.DoGroup children: [ (C {<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 (braced_var_sub token:<Id.VSub_Name FILES> bracket_op:(bracket_op.WholeArray op_id:Id.Lit_At)))} ) ] ) ) ) ] ) ) (command.ShFunction name: test-wc body: (command.BraceGroup children: [ (command.TimeBlock pipeline: (command.ForEach iter_name: i iter_words: [ (word.BracedTree parts: [(word_part.BracedRange kind:Id.Range_Int start:1 end:10 step:1)] ) ] do_arg_iter: F body: (command.DoGroup children: [ (command.Pipeline children: [ (C {<cat>} { (DQ (braced_var_sub token: <Id.VSub_Name FILES> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) (C {<wc>} {<-c>}) ] negated: F ) ] ) ) ) ] ) ) (command.ShFunction name: files body: (command.BraceGroup children: [ (C {<echo>} { (DQ (braced_var_sub token: <Id.VSub_Name FILES> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) ) } ) (C {<echo>} { (DQ (braced_var_sub token: <Id.VSub_Name FILES> prefix_op: (Id.VSub_Pound) bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) ) <' files'> ) } ) ] ) ) (C {(DQ ($ Id.VSub_At '$@'))}) ] )