(command.CommandList children: [ (C {(umask)} {(022)}) (command.Case to_match: {($ VSub_Number '$0')} arms: [ (case_arm pat_list: [{(Lit_Other '*') (/) (Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:srcdir spids:[93]) op: Equal rhs: { (word_part.BracedVarSub token: <VSub_Number 0> suffix_op: (suffix_op.StringUnary op_id: VOp1_Percent arg_word: {(Lit_Slash /) ('*')} ) spids: [94 99] ) } spids: [93] ) ] spids: [93] ) ] spids: [85 91 101 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:srcdir spids:[109]) op: Equal rhs: {(.)} spids: [109] ) ] spids: [109] ) ] spids: [103 107 112 16777215] ) ] spids: [79 83 114] ) (command.AndOr ops: [Op_DPipe] children: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:srcdir spids:[116]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$srcdir'))}) (C {(pwd)} {(-P)}) ] ) ] ) left_token: <Left_CommandSub '$('> spids: [117 129] ) } spids: [116] ) ] spids: [116] ) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.AndOr ops: [Op_DPipe] children: [ (C {(cd)} {(DQ ($ VSub_DollarName '$srcdir'))}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) (command.FuncDef name: usage body: (command.BraceGroup children: [ (C {(echo)} {(DQ ('usage: ') ($ VSub_Number '$0') (' [ -n ] [ -f ] [ -d INSTALLROOT ]'))}) (C {(echo)} {(DQ ('\t-n: non-interactive operation'))}) (C {(echo)} {(DQ ('\t-f: delete */modernish directories even if files left'))}) (C {(echo)} {(DQ ('\t-d: specify root directory of modernish installation to uninstall'))}) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [150] ) redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})] spids: [146 149] ) (C {(unset)} {(-v)} {(opt_n)} {(opt_f)} {(installroot)}) (command.WhileUntil keyword: <KW_While while> cond: [(command.Sentence child:(C {(getopts)} {(SQ <'nfd:'>)} {(opt)}) terminator:<Op_Semi ';'>)] body: (command.DoGroup children: [ (command.Case to_match: {($ VSub_DollarName '$opt')} arms: [ (case_arm pat_list: [{(word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\?'>)}] action: [(C {(usage)})] spids: [227 231 235 16777215] ) (case_arm pat_list: [{(n)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_n spids:[244]) op: Equal rhs: {(SQ )} spids: [244] ) ] spids: [244] ) ] spids: [238 242 248 16777215] ) (case_arm pat_list: [{(f)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:opt_f spids:[260]) op: Equal rhs: {(SQ )} spids: [260] ) ] spids: [260] ) ] spids: [254 258 264 16777215] ) (case_arm pat_list: [{(d)}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:installroot spids:[276]) op: Equal rhs: {($ VSub_DollarName '$OPTARG')} spids: [276] ) ] spids: [276] ) ] spids: [270 274 279 16777215] ) ] spids: [220 224 285] ) ] spids: [217 287] ) ) (C {(shift)} { (word_part.ArithSubPart anode: (arith_expr.ArithBinary op_id: Arith_Minus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$OPTIND')}) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) spids: [291 298] ) } ) (command.Case to_match: {($ VSub_Pound '$#')} arms: [ (case_arm pat_list: [{(Lit_Other '[') (KW_Bang '!') (0) (Lit_Other ']') (Lit_Other '*')}] action: [(C {(usage)})] spids: [306 314 318 16777215] ) ] spids: [300 304 320] ) (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:MSH_SHELL spids:[338]) op: Equal rhs: {(SQ )} spids: [338] ) ] spids: [338] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.SimpleCommand words: [{(command)} {(-v)} {(modernish)}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) terminator: <Op_Semi ';'> ) ] action: [ (command.SimpleCommand words: [{(read)} {(junk)} {(junk)} {(MSH_SHELL)} {(junk)}] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: { (DQ (word_part.CommandSubPart command_list: (command.CommandList children: [(C {(command)} {(-v)} {(modernish)})] ) left_token: <Left_CommandSub '$('> spids: [382 388] ) ) } ) ] more_env: [(env_pair name:IFS val:{(DQ ('#!') ($ VSub_DollarName '$IFS'))} spids:[364])] ) ] spids: [16777215 357] ) ] spids: [16777215 391] ) (command.ForEach iter_name: MSH_SHELL iter_words: [ {(DQ ($ VSub_DollarName '$MSH_SHELL'))} {(/bin/sh)} {(dash)} {(yash)} {(bash)} {(ksh)} {(ksh93)} {(mksh)} {(oksh)} {(pdksh)} {(zsh)} {(zsh4)} {(zsh5)} {(ash)} ] do_arg_iter: F body: (command.DoGroup children: [ (command.AndOr ops: [Op_DPipe] children: [ (command.SimpleCommand words: [{(command)} {(-v)} {(DQ ($ VSub_DollarName '$MSH_SHELL'))}] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] ) (command.Case to_match: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(DQ ($ VSub_DollarName '$MSH_SHELL'))} {(-c)} {(SQ <'echo "$PPID"'>)}) ] ) left_token: <Left_CommandSub '$('> spids: [454 464] ) } arms: [ (case_arm pat_list: [ {(SQ )} {(Lit_Other '*') (Lit_Other '[') (KW_Bang '!') (0123456789) (Lit_Other ']') (Lit_Other '*') } ] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:MSH_SHELL spids:[486]) op: Equal rhs: {(SQ )} spids: [486] ) ] spids: [486] ) (command.ControlFlow token:<ControlFlow_Continue continue>) ] spids: [469 483 493 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (command.Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (lhs_expr.LhsName name:MSH_SHELL spids:[502]) op: Equal rhs: { (word_part.CommandSubPart command_list: (command.CommandList children: [ (C {(command)} {(-v)} {(DQ ($ VSub_DollarName '$MSH_SHELL'))}) ] ) left_token: <Left_CommandSub '$('> spids: [503 511] ) } spids: [502] ) ] spids: [502] ) (command.ControlFlow token:<ControlFlow_Break break>) ] spids: [496 500 516 16777215] ) ] spids: [452 466 519] ) ] spids: [430 521] ) spids: [398 428] ) (command.Case to_match: {($ VSub_DollarName '$MSH_SHELL')} arms: [ (case_arm pat_list: [{(SQ )}] action: [ (command.SimpleCommand words: [ {(echo)} { (DQ ("Fatal: can't find any shell with ") (word_part.EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('PPID!') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(125)}) ] spids: [529 534 552 16777215] ) ] spids: [523 527 554] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.BraceGroup children: [ (command.Sentence child: (command.Subshell child: (C {(eval)} {(DQ ('. bin/modernish'))}) spids: [584 590] ) terminator: <Op_Amp '&'> ) (command.Sentence child: (C {(wait)} {(DQ ($ VSub_Bang '$!'))}) terminator: <Op_Semi ';'> ) ] spids: [582] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)}) (C {(echo)} { (DQ ("The shell executing this script can't run modernish. Try running uninstall.sh")) } ) (C {(echo)} {(DQ ('with a more fully POSIX-compliant shell, for instance: dash uninstall.sh'))} ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(3)}) ] spids: [16777215 604] ) ] redirects: [(redir.Redir op:<Redir_GreatAnd '1>&'> fd:1 arg_word:{(2)})] spids: [16777215 628] ) (C {(.)} {(bin/modernish)}) (C {(use)} {(safe)} {(-w)} {(BUG_APPENDC)} {(-w)} {(BUG_UPP)}) (C {(use)} {(var/arith/cmp)}) (C {(use)} {(loop/select)} {(-w)} {(BUG_SELECTEOF)} {(-w)} {(BUG_SELECTRPL)}) (C {(use)} {(sys/base/which)}) (C {(use)} {(sys/dir)}) (C {(use)} {(var/string)}) (C {(use)} {(sys/user/id)} {(-f)}) (C {(harden)} {(-p)} {(-t)} {(rm)}) (C {(harden)} {(-p)} {(-t)} {(rmdir)}) (C {(harden)} {(-p)} {(ls)}) ] )