(CommandList children: [ (C {(Lit_Other ":")}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:command) op:Equal rhs:{(crontab)} spids:[66])] spids: [66] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:prefix) op: Equal rhs: { (BracedVarSub token: <VSub_Number 0> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*") (Lit_Slash /)}) spids: [70 75] ) } spids: [69] ) ] spids: [69] ) (Case to_match: {($ VSub_Name "$prefix")} arms: [ (case_arm pat_list: [{(Lit_Other "*") (_) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:prefix) op: Equal rhs: { (BracedVarSub token: <VSub_Name prefix> suffix_op: (StringUnary op_id:VOp1_DPercent arg_word:{("_*")}) spids: [89 93] ) (_) } spids: [88] ) ] spids: [88] ) ] spids: [83 86 96 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:prefix) op:Equal rhs:{(SQ )} spids:[101])] spids: [101] ) ] spids: [98 99 103 -1] ) ] spids: [77 81 105] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:cron) op: Equal rhs: {(DQ (${ VSub_Name prefix) ("at -qc"))} spids: [107] ) ] spids: [107] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {($ VSub_Name "$HOME") (/.) ($ VSub_Name "$command")} spids: [115] ) ] spids: [115] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:replace) op:Equal rhs:{(SQ )} spids:[120])] spids: [120] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:temp) op: Equal rhs: { (BracedVarSub token: <VSub_Name TMPDIR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(Lit_Slash /) (tmp)}) spids: [123 128] ) (/cron) ($ VSub_Dollar "$$") } spids: [122] ) ] spids: [122] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:op) op:Equal rhs:{(SQ )} spids:[132])] spids: [132] ) (Case to_match: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (SimpleCommand words: [{(getopts)} {(SQ <"[-][123:xyz]">)} {(opt)} {(--xyz)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[148])] ) terminator: <Op_Semi ";"> ) (C {(echo)} {(0) ($ VSub_Name "$opt")}) ] ) left_token: <Left_CommandSub "$("> spids: [137 156] ) } arms: [ (case_arm pat_list: [{(0123)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:usage) op: Equal rhs: { (SQ <"\n"> <"[-?\n"> <"@(#)$Id: crontab (AT&T Labs Research) 2006-05-17 $\n"> <"]\n"> ) ($ VSub_Name "$USAGE_LICENSE") (SQ <"\n"> <"[+NAME?crontab - schedule periodic background work]\n"> <"[+DESCRIPTION?"> <Lit_EscapedChar "\\b"> <crontab> <Lit_EscapedChar "\\b"> <" creates, replaces or edits the calling user crontab\n"> <"\tentry; a crontab entry is a list of commands and the times at which\n"> <"\tthey are to be executed. The new crontab entry can be input by\n"> <"\tspecifying "> <Lit_EscapedChar "\\a"> <file> <Lit_EscapedChar "\\a"> <", or input from standard input if "> <Lit_EscapedChar "\\a"> <file> <Lit_EscapedChar "\\a"> <" is\n"> <"\tomitted, or by using an editor, if "> <Lit_EscapedChar "\\b"> <--edit> <Lit_EscapedChar "\\b"> <" is specified. The\n"> <"\tactual crontab entry is maintained in the file "> <Lit_EscapedChar "\\b"> <"$HOME/.crontab"> <Lit_EscapedChar "\\b"> <".]\n"> < "[+?Upon execution of a command from a crontab entry, the implementation will\n" > <"\tsupply a default environment, defining at least the following\n"> <"\tenvironment variables:]{\n"> <"\t[+HOME?A pathname of the calling user home directory.]\n"> <"\t[+LOGNAME?The calling user login name.]\n"> <"\t[+PATH?A string representing a search path guaranteed to find all\n"> <"\t\tof the standard utilities.]\n"> <"\t[+SHELL?A pathname of the command interpreter "> <Lit_EscapedChar "\\b"> <sh> <Lit_EscapedChar "\\b"> <"(1).]\n"> <"}\n"> < "[+?If standard output and standard error are not redirected by commands\n" > <"\texecuted from the crontab entry, any generated output or errors will\n"> <"\tbe mailed to the calling user.]\n"> <"[+?Users are permitted to use "> <Lit_EscapedChar "\\b"> <crontab> <Lit_EscapedChar "\\b"> <" if their names appear in the file\n"> <"\t"> <Lit_EscapedChar "\\b"> </usr/lib/cron/cron.allow> <Lit_EscapedChar "\\b"> <". If that file does not exist, the file\n"> <"\t"> <Lit_EscapedChar "\\b"> </usr/lib/cron/cron.deny> <Lit_EscapedChar "\\b"> <" is checked to determine if the calling user\n"> <"\tshould be denied access to "> <Lit_EscapedChar "\\b"> <crontab> <Lit_EscapedChar "\\b"> <". If neither file exists, only\n"> <"\ta process with appropriate privileges is allowed to submit a job. If\n"> <"\tonly "> <Lit_EscapedChar "\\b"> <cron.deny> <Lit_EscapedChar "\\b"> <" exists and is empty, global usage is permitted. The\n"> <"\t"> <Lit_EscapedChar "\\b"> <cron.allow> <Lit_EscapedChar "\\b"> <" and "> <Lit_EscapedChar "\\b"> <cron.deny> <Lit_EscapedChar "\\b"> <" files consist of one user name per\n"> <"\tline.]\n"> <"[+?In this implementation, each command in the "> <Lit_EscapedChar "\\b"> <crontab> <Lit_EscapedChar "\\b"> <" file represents\n"> <"\ta single "> <Lit_EscapedChar "\\b"> <at> <Lit_EscapedChar "\\b"> <"(1) "> <Lit_EscapedChar "\\a"> <job> <Lit_EscapedChar "\\a"> <". Only one job per command will be executed.\n"> < "\tA new job for a given command will not be scheduled until the previous\n" > <"\tjob for that command, if any, has exited.]\n"> < "[e:edit?Edit a copy of the calling user crontab entry, or create an empty\n" > <"\tentry to edit if the crontab entry does not exist. When editing is\n"> <"\tcomplete, the entry will be installed as the calling user crontab\n"> <"\tentry. The editor used is defined by the "> <Lit_EscapedChar "\\b"> <EDITOR> <Lit_EscapedChar "\\b"> <" environment\n"> <"\tvariable. The default editor is "> <Lit_EscapedChar "\\b"> <vi> <Lit_EscapedChar "\\b"> <"(1).]\n"> <"[l:list?List the calling user crontab entry.]\n"> <"[r:remove|delete?Remove the calling user crontab entry.]\n"> <"\n"> <"[ file ]\n"> <"\n"> < "[+INPUT FILES?A crontab entry must be a text file consisting of lines of six\n" > <"\tfields each. The fields must be separated by blank characters. The\n"> <"\tfirst five fields must be integer patterns that specify the\n"> <"\tfollowing:]{\n"> <"\t[+1.?Minute (0-59)]\n"> <"\t[+2.?Hour (0-23)]\n"> <"\t[+3.?Day of the month (1-31)]\n"> <"\t[+4.?Month of the year (1-12)]\n"> <"\t[+5.?Day of the week (0-6 with 0=Sunday)]\n"> <"}\n"> < "[+?Each of these patterns can be either an asterisk (meaning all valid\n" > <"\tvalues), an element or a list of elements separated by commas.\n"> <"\tAn element must be either a number or two numbers separated by a\n"> <"\thyphen (meaning an inclusive range). The specification of days can\n"> <"\tbe made by two fields (day of the month and day of the week). If\n"> <"\tmonth, day of month and day of week are all asterisks, every day\n"> <"\twill be matched. If either the month or day of month is specified\n"> <"\tas an element or list, but the day of week is an asterisk, the\n"> <"\tmonth and day of month fields will specify the days that match. If\n"> <"\tboth month and day of month are specified as asterisk, but day of\n"> <"\tweek is an element or list, then only the specified days of the\n"> <"\tweek will match. Finally, if either the month or day of month is\n"> <"\tspecified as an element or list, and the day of week is also\n"> <"\tspecified as an element or list, then any day matching either the\n"> <"\tmonth and day of month or the day of week, will be matched.]\n"> <"[+?The sixth field of a line in a crontab entry is a string that will\n"> <"\tbe executed by "> <Lit_EscapedChar "\\b"> <sh> <Lit_EscapedChar "\\b"> <" at the specified times. A percent sign character\n"> <"\tin this field will be translated to a newline character. Any\n"> <"\tcharacter preceded by a backslash (including the %) causes that\n"> < "\tcharacter to be treated literally. Only the first line (up to a \"%\"\n" > <"\tor end-of-line) of the command field will be executed by the\n"> <"\tcommand interpreter. The other lines will be made available to the\n"> <"\tcommand as standard input.]\n"> < "[+?A job label is generated by a readable hash of the command. If the first\n" > <"\tcharacters are "> <Lit_EscapedChar "\\b"> <":"> <Lit_EscapedChar "\\b"> <" "> <Lit_EscapedChar "\\a"> <label> <Lit_EscapedChar "\\a"> <Lit_EscapedChar "\\b"> <";"> <Lit_EscapedChar "\\b"> <" then the job label will be set to\n"> <"\t"> <Lit_EscapedChar "\\a"> <label> <Lit_EscapedChar "\\a"> <" verbatim. Job labels are limited to 12 characters.]\n"> <"[+?Blank lines and those whose first non-blank character is \"#\" will\n"> <"\tbe ignored.]\n"> <"[+FILES]{\n"> <"\t[+$HOME/.crontab?Edited per-user crontab entry file.]\n"> <"}\n"> <"[+SEE ALSO?"> <Lit_EscapedChar "\\b"> <at> <Lit_EscapedChar "\\b"> <"(1), "> <Lit_EscapedChar "\\b"> <batch> <Lit_EscapedChar "\\b"> <"(1), "> <Lit_EscapedChar "\\b"> <sh> <Lit_EscapedChar "\\b"> <"(1)]\n"> ) } spids: [163] ) ] spids: [163] ) ] spids: [160 161 362 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:usage) op: Equal rhs: {(SQ <"elr [ file ]">)} spids: [367] ) ] spids: [367] ) ] spids: [364 365 373 -1] ) ] spids: [135 158 375] ) (While cond: [(C {(getopts)} {(DQ ($ VSub_Name "$usage"))} {(OPT)})] body: (DoGroup children: [ (Case to_match: {($ VSub_Name "$OPT")} arms: [ (case_arm pat_list: [{(e)}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:op) op:Equal rhs:{(edit)} spids:[404])] spids: [404] ) ] spids: [401 402 407 -1] ) (case_arm pat_list: [{(l)}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:op) op:Equal rhs:{(list)} spids:[413])] spids: [413] ) ] spids: [410 411 416 -1] ) (case_arm pat_list: [{(r)}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:op) op:Equal rhs:{(remove)} spids:[422])] spids: [422] ) ] spids: [419 420 425 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Usage: ") ($ VSub_Name "$command") (" [-elr] [ file ]"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[439])] ) (C {(exit)} {(2)}) ] spids: [428 429 448 -1] ) ] spids: [394 398 451] ) ] spids: [392 453] ) ) (C {(shift)} { (ArithSubPart anode: (ArithBinary op_id: Arith_Minus left: (ArithVarRef name:OPTIND) right: (ArithWord w:{(Lit_Digits 1)}) ) spids: [457 462] ) } ) (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list:[{(0)}] spids:[470471473-1]) (case_arm pat_list: [{(1)}] action: [ (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:replace) op: Equal rhs: {($ VSub_Number "$1")} spids: [478] ) ] spids: [478] ) terminator: <Op_Semi ";"> ) (C {(shift)}) ] spids: [475 476 484 -1] ) ] spids: [464 468 486] ) (Case to_match: {($ VSub_Name "$op")} arms: [ (case_arm pat_list: [{(SQ )}] action: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:op) op:Equal rhs:{(replace)} spids:[498])] spids: [498] ) ] spids: [-1 496 501 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Case to_match: {($ VSub_Name "$replace")} arms: [ (case_arm pat_list: [{(Lit_Other "?") (Lit_Other "*")}] action: [(C {(set)} {(--)} {(SQ <"-?">)})] spids: [513 515 525 -1] ) ] spids: [506 510 528] ) ] spids: [503 504 531 -1] ) ] spids: [488 492 533] ) (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list:[{(0)}] spids:[541542544-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Sentence child: (C {(getopts)} {(DQ ($ VSub_Name "$usage"))} {(OPT)}) terminator: <Op_Semi ";"> ) (C {(exit)} {(2)}) ] spids: [546 547 562 -1] ) ] spids: [535 539 564] ) (C {(set)} {(-o)} {(errexit)} {(-o)} {(noglob)}) (C {($ VSub_Name "$cron")} {(-a)}) (C {(umask)} {(077)}) (Case to_match: {($ VSub_Name "$op")} arms: [ (case_arm pat_list: [{(edit)}] action: [ (C {(trap)} {(DQ ("rm -f '") ($ VSub_Name "$temp") ("'"))} {(0)} {(1)} {(2)} {(3)} {(15)}) (If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_Name "$file"))})] action: [(C {(cat)} {(DQ ($ VSub_Name "$file"))})] spids: [-1 633] ) ] else_action: [(C {(print)} {(DQ ("# MIN HOUR DAY/MONTH MONTH DAY/WEEK COMMAND"))})] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$temp"))} spids: [653] ) ] spids: [642 651] ) (C { (BracedVarSub token: <VSub_Name VISUAL> suffix_op: (StringUnary op_id: VTest_ColonHyphen arg_word: { (BracedVarSub token: <VSub_Name EDITOR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(vi)}) spids: [663 667] ) } ) spids: [660 668] ) } {(DQ ($ VSub_Name "$temp"))} ) ] spids: [600 601 675 -1] ) (case_arm pat_list: [{(list)}] action: [ (If arms: [ (if_arm cond: [(C {(test)} {(-f)} {(DQ ($ VSub_Name "$file"))})] action: [(C {(cat)} {(DQ ($ VSub_Name "$file"))})] spids: [-1 691] ) ] spids: [-1 700] ) (C {(exit)}) ] spids: [677 678 706 -1] ) (case_arm pat_list: [{(remove)}] action: [ (C {($ VSub_Name "$cron")} {(-r)}) (C {(rm)} {(-f)} {(DQ ($ VSub_Name "$file"))}) (C {(exit)}) ] spids: [708 709 728 -1] ) (case_arm pat_list: [{(replace)}] action: [ (C {(trap)} {(DQ ("rm -f '") ($ VSub_Name "$temp") ("'"))} {(0)} {(1)} {(2)} {(3)} {(15)}) (Case to_match: {($ VSub_Name "$replace")} arms: [ (case_arm pat_list: [{(-)}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:temp) op: Equal rhs: {($ VSub_Name "$file")} spids: [761] ) ] spids: [761] ) ] spids: [758 759 764 -1] ) (case_arm pat_list: [{(DQ )}] action: [ (SimpleCommand words: [{(cat)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$temp"))} spids: [773] ) ] ) ] spids: [-1 769 779 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (SimpleCommand words: [{(cat)} {(DQ ($ VSub_Name "$replace"))}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(DQ ($ VSub_Name "$temp"))} spids: [791] ) ] ) ] spids: [782 783 797 -1] ) ] spids: [751 755 800] ) (C {(test)} {(-s)} {(DQ ($ VSub_Name "$temp"))}) ] spids: [730 731 812 -1] ) ] spids: [594 598 814] ) (SimpleCommand words: [{(exec)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[818])] ) (While cond: [(C {(read)} {(-r)} {(line)})] body: (DoGroup children: [ (C {(set)} {(SQ )} {($ VSub_Name "$line")}) (C {(shift)}) (Case to_match: {($ VSub_Number "$1")} arms: [ (case_arm pat_list: [{(SQ )} {(SQ <"#">) (Lit_Other "*")}] action: [(ControlFlow token:<ControlFlow_Continue continue>)] spids: [-1 862 865 -1] ) ] spids: [848 852 868] ) (Case to_match: {($ VSub_Pound "$#")} arms: [ (case_arm pat_list: [{(Lit_Other "[") (0-5) (Lit_Other "]")}] action: [ (C {(print)} {(-u2)} { (DQ ($ VSub_Name "$command") (": ") ($ VSub_Name "$line") (": invalid entry")) } ) ] spids: [878 881 -1 895] ) ] spids: [871 875 895] ) (C {($ VSub_Name "$cron")} {(-n)} {(-t)} { (DQ ("cron ") ($ VSub_Number "$1") (" ") ($ VSub_Number "$2") (" ") ($ VSub_Number "$3") (" ") ($ VSub_Number "$4") (" ") ($ VSub_Number "$5") ) } {(true)} ) ] spids: [835 919] ) redirects: [(Redir op_id:Redir_Less fd:-1 arg_word:{(DQ ($ VSub_Name "$temp"))} spids:[921])] ) (C {($ VSub_Name "$cron")} {(-r)}) (While cond: [(C {(read)} {(-r)} {(line)})] body: (DoGroup children: [ (C {(set)} {(SQ )} {($ VSub_Name "$line")}) (C {(shift)}) (Case to_match: {($ VSub_Number "$1")} arms: [ (case_arm pat_list: [{(SQ )} {(SQ <"#">) (Lit_Other "*")}] action: [(ControlFlow token:<ControlFlow_Continue continue>)] spids: [-1 971 974 -1] ) ] spids: [957 961 977] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:time) op: Equal rhs: { (DQ ($ VSub_Number "$1") (" ") ($ VSub_Number "$2") (" ") ($ VSub_Number "$3") (" ") ($ VSub_Number "$4") (" ") ($ VSub_Number "$5") ) } spids: [980] ) ] spids: [980] ) (C {(shift)} {(5)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:exec) op: Equal rhs: { (BracedVarSub token: <VSub_Star "*"> suffix_op: (PatSub pat: {(EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) ("(?)")} replace: {("\u0001") (EscapedLiteralPart token:<Lit_EscapedChar "\\1">)} do_all: True do_prefix: False do_suffix: False ) spids: [1000 1009] ) } spids: [999] ) ] spids: [999] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:exec) op: Equal rhs: { (BracedVarSub token: <VSub_Name exec> suffix_op: (PatSub pat: {("@([!\u0001])") (Lit_Percent "%")} replace: {(EscapedLiteralPart token:<Lit_EscapedChar "\\1">) ("\n")} do_all: True do_prefix: False do_suffix: False ) spids: [1013 1022] ) } spids: [1012] ) ] spids: [1012] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:exec) op: Equal rhs: { (BracedVarSub token: <VSub_Name exec> suffix_op: (PatSub pat: {("^A")} replace: {(EscapedLiteralPart token:<Lit_EscapedChar "\\\\">)} do_all: True do_prefix: False do_suffix: False ) spids: [1026 1033] ) } spids: [1025] ) ] spids: [1025] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:exec) op: Equal rhs: { (BracedVarSub token: <VSub_Name exec> suffix_op: (PatSub pat: {("@(\n") ("*)")} replace: {(EscapedLiteralPart token:<Lit_EscapedChar "\\<">) (EscapedLiteralPart token: <Lit_EscapedChar "\\<"> ) (EscapedLiteralPart token:<Lit_EscapedChar "\\\\">) ("\u0001\n") (EscapedLiteralPart token: <Lit_EscapedChar "\\1"> ) ("\n") ("\u0001") } do_all: True do_prefix: False do_suffix: False ) spids: [1037 1051] ) } spids: [1036] ) ] spids: [1036] ) (SimpleCommand words: [ {($ VSub_Name "$cron")} {(-t)} {(DQ ("cron ") ($ VSub_Name "$time"))} {(DQ ($ VSub_Name "$exec"))} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[1067])] ) ] spids: [944 1071] ) redirects: [(Redir op_id:Redir_Less fd:-1 arg_word:{(DQ ($ VSub_Name "$temp"))} spids:[1073])] ) (Case to_match: {($ VSub_Name "$replace")} arms: [ (case_arm pat_list:[{(-)}] spids:[108510861088-1]) (case_arm pat_list: [{(Lit_Other "*")}] action: [(C {(cp)} {(DQ ($ VSub_Name "$temp"))} {(DQ ($ VSub_Name "$file"))})] spids: [1090 1091 1103 -1] ) ] spids: [1079 1083 1105] ) ] )