Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Dec 1999 11:56:03 -0800 (PST)
From:      Joss Roots <osiris2002@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Is there a way to do this using ls command ?
Message-ID:  <19991228195603.2204.qmail@web115.yahoomail.com>

next in thread | raw e-mail | index | archive | help
hi there,
I am trying to make a shell script get the names
of directories from a certain path;

/usr/ports/audio

and I want to just put the output into a file
say /home/joss/ports-audio

that's the easy part.
The thing I want for this script is to do some
inteliigent step(s) to do the following:

1. don't include, or otherwise strip, all entries
that are NOT directories, so as NOT to save them
in the generated output file
for example ls -F | grep /
(but this will output a trailing / after each and
every directory name), so how to strip this
can this be done using sed, or something else ?

2. Remove certain directory entries form the
list, for  example CVS/ , pkg/
before saving the final output to the file.

3. the list must be sequential listing one entry 
on a seperate line. (like issuing simple ls)

can anyone help me through this.
thanks in advance.



=====
MAY THE FORCE BE WITH YOU.
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://messenger.yahoo.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991228195603.2204.qmail>