And, by the way, the correct answer is not in the list! Because all
answers fail to take hidden files (that start with a ".") into account,
because they won't be matches by a single *,

the correct answer is:

cat .[^.]* * > all_in_one

And then again, directories being matched would give an error. So better
even might be:

cat `find . -type f -maxdepth 1` >all_in_one

++Jos

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.
> 
> 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.
> >
> >James.
> >--
> > "Yield to temptation --             | Consultancy: [EMAIL PROTECTED]
> >  it may not pass your way again"    | http://www.cloud9.co.uk/james
> >                                     |
> >        - Lazarus Long               |              James Fidell
> >
> >
> >________________________________________________________________________
> >This message was sent by the linux-cert-program mailing list. To unsubscribe:
> >echo unsubscribe | mail -s '' [EMAIL PROTECTED]
> >
> 
> Regards
> -------
> Richard Sharpe, [EMAIL PROTECTED], NS Computer Software and Services P/L,
> Samba (Team member www.samba.org), Ethereal (Team member www.zing.org)
> Co-author, SAMS Teach Yourself Samba in 24 Hours
> 
> ________________________________________________________________________
> This message was sent by the linux-cert-program mailing list. To unsubscribe:
> echo unsubscribe | mail -s '' [EMAIL PROTECTED]

-- 
I am the josv in josv.com :-)

By the way, I am continuing to Live Without Windows! 
Latest article: http://josv.com/~me/lww_dos.html
begin:vcard 
n:Visser;Jos
tel;fax:+31-20-4950 223
tel;home:+31-36-522 0400
tel;work:+31-20-4950 222
x-mozilla-html:FALSE
url:http://www.osp.nl/~josv
org:Open Solution Providers
adr:;;Dalsteindreef 16;Diemen;;NL-1112 XC;Kingdom of the Netherlands
version:2.1
email;internet:[EMAIL PROTECTED]
x-mozilla-cpt:;0
fn:Jos Visser
end:vcard

Reply via email to