Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jens Schweikhardt Newsgroups: comp.unix.shell,comp.unix.programmer,comp.programming.contests Subject: Re: The First Pure Shell Contest (PUSH): relativepath Date: 19 Aug 2011 20:04:48 GMT Lines: 56 Sender: Jens Schweikhardt Message-ID: <9b7tv0FiseU4@mid.individual.net> References: <9b7kg7F3njU1@mid.individual.net> <9b7qtqFiseU1@mid.individual.net> <9b7rsrFiseU3@mid.individual.net> X-Trace: individual.net YT4w6FKNF3Kk2rLqLcOB0AfZ5eH/w+0Ah7aePZRTCRREIlI3ji X-Orig-Path: not-for-mail Cancel-Lock: sha1:dZs2znrnkoMSOl2NpXkONJAJZs4= User-Agent: tin/1.9.6-20101126 ("Burnside") (UNIX) (FreeBSD/9.0-CURRENT (i386)) Xref: x330-a1.tempe.blueboxinc.net comp.unix.shell:1725 comp.unix.programmer:1164 comp.programming.contests:15 In comp.unix.programmer pk wrote: # On 19 Aug 2011 19:29:31 GMT, Jens Schweikhardt # wrote: # #> In comp.unix.shell pk wrote: #> # On 19 Aug 2011 19:12:58 GMT, Jens Schweikhardt #> # wrote: #> # #> #> # Awk and Perl are built in my POSIX shell and not "[". Which am I #> #> # allowed to use? #> #> #> #> Then our understanding of the term "built-in" is very different and #> #> I'm afraid it is yours that is the non-conventional one. #> # #> # POSIX does not forbid a shell to have whatever you may think of #> built-in. #> #> And because I am aware of that I made explicit references to test and [ #> and printf. I'll never understand why people try so hard to #> misunderstand on purpose... :-) # # Still, I don't see where your rules forbid using Perl or Awk if one's POSIX # shell has them built-in (which was the OP's question). It forbidden by the well known standardese rule of "if it's not defined, then it's undefined." aka "undefined by omission". 3 You can assume that 'test' and '[' are built-ins. If this is not true for your shell you may set PATH with env -i PATH=... to the directory with the 'test' and '[' executables for the sole purpose of using these external commands. It must run without PATH on a shell where these are built-ins (i.e. on the contest evaluation machine). perl isn't mentioned. So you can not assume it is a built-in. I believe that the name of the contest gives an oh so slight hint that a solution involving perl is not quite what is meant. The motivation paragraph too (even mentions awk). If that isn't enough, the contestant would surely wonder if perl was also a built-in on the unknown contest evaluation machine. Reading a text, understanding it and inferring a writer's intention are the initial barriers to participating in the contest. I think this goes for most contests. I admit there is room for improvement regarding its formal "rules" (heck, the very word does not even appear once!), but I did not want to overload the text with kilobytes of blah blah just to fend off the nit-pickers, who would find a hole in any formal set of rules. One thing I really should add for the next PUSH is "Rule interpretation is MINE ALONE. PERIOD!" :-) Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped)