On Thu, 1 Jul 1999, Richard Sharpe wrote:
> At 02:35 PM 6/30/99 +0100, James Fidell <[EMAIL PROTECTED]> wrote:
> >Quoting Richard Sharpe ([EMAIL PROTECTED]):
> >> 3.1b Which one of the following is the correct command to
> >> store all of the contents of all files in the
> >> present working directory (or pwd) into a single new file called
> >> 'all_in_one'?
> >> a cat * > all_in_one
> >> b cp * all_in_one
> >> c cat * >> all_in_one
> >> d All of the above
> >>
> >> C is given as the correct answer, but it seems clearly wrong. If all_in_one
> >> already exists, then its contents will be appended with the contents of the
> >> other files.
> >
> >I assumed that the phrase "new file" meant that it didn't already exist,
> >in which case either A or C should be acceptable.
> >
> >If the file does already exist, then a will truncate the existing file
> >and c won't, and both give an error message.
>
> Hmmm, well, I tried it on TurboLinux 3.4.0, and did not get an error.
This probably depends on how "clobber" is set (in bash: SHELLOPTS). If
"clobber" then a) will work, if "noclobber" then cat will refuse a).
With c) (append): if you `cat *` and all_in_one exists, then cat will
complain that "input is output" but do it anyway.
The question specifically mentions a NEW file however, so all this is
academical.
> I guess that I mis-understood the question, and now consider it to be
> ambiguous. There is definitely no need for the >> as well.
>
> >I'd agree that C shouldn't be the correct answer for this.
I agree with the others that a) and not c) is the best answer.
I suppose Sair put rejected questions as examples on the web. I hope for
them (not for us) that the quality of their actual exams will be better.
--
#>!$!%(@^%#%*(&(#@#*$^@^$##*#@&(%)@**$!(&!^(#((#&%!)%*@)(&$($$%(@#)&*!^$)^@*^@)
Tom "thriving on chaos" Peters
NL-1062 KD nr 149 tel. 31-204080204
Amsterdam e-mail [EMAIL PROTECTED]
________________________________________________________________________
This message was sent by the linux-cert-program mailing list. To unsubscribe:
echo unsubscribe | mail -s '' [EMAIL PROTECTED]