Re: Homework Question: egrep and piping

From: Charles LaCour (nospam_at_lacour.homelinux.com)
Date: 12/30/03


Date: Tue, 30 Dec 2003 01:28:00 GMT

Tarvok wrote:
> Hello, this is sort of a homework question, though its homework I
> assigned myself. I'm going through the last two chapters of a book
> which weren't covered in the class it was used in (Carolyn Z. Gillay's
> _Linux User's Guide_, if anybody cares), and I came across an activity
> I simply can't figure out the answer to.
>
> Here is the exact text: "Create an alias called lfdo that lists all
> the directories in only /mnt/floppy *not including* child directories,
> but does not list files. (Hint: remember egrep and piping.)
>
> Yes, the disk is mounted. Yes, I successfully created the alias in the
> previous assignment, which wasn't so complex. I don't think I
> understand egrep well enough to do this. Can anybody help?
>
>
> - Tarvok
Try aliasing the following command:
ls -l /mnt/floppy | egrep '^d'

The first character of the ls -l output will be a 'd' for directories so
the regex '^d' selects the lines that start with 'd'.

If you want to learn more than you ever wanted to know about regular
expressions you may want to get the O'Reilly book called 'Mastering
Regular Expressions, 2nd edition'

-- 
Thanks
Charles LaCour


Relevant Pages

  • Re: little endian or big endian ???
    ... char *cptr; ... printf; ... This most probably isn't a homework question. ... assignment. ...
    (comp.lang.c)
  • Homework Question: egrep and piping
    ... Hello, this is sort of a homework question, though its homework I ... the directories in only /mnt/floppy *not including* child directories, ... previous assignment, which wasn't so complex. ... understand egrep well enough to do this. ...
    (linux.redhat)
  • Re: Question re transmission speeds
    ... assignment on an IT course, and one of the questions asked is this: ... "What general combinations of hardware and software offer very slow or fast ... Well, Craig, I'm sorry if this sounds rude, but the best advice you can ... least being upfront about it being a 'Homework Question', ...
    (uk.comp.homebuilt)
  • Re: Need clarification on terms in chemical industry
    ... His supervisor is a chemistry teacher I believe who gave out this ... assignment ... ... Oh, nuts. ... a homework question. ...
    (sci.chem)