Unix ksh script help
#1
Hi,
I currently writing a ksh script but i'm stuck.
Example of what I'm trying to do.
find . -name "*.doc" -print
or
ls -ltr ¦grep .doc ¦awk '{print $9}'
either way this will list all documents in the current directory that have extensions ending in .doc.
What I want though is to find out how many instances of .docs there are from the generated list as above. So if the list brings back 5 .docs I want to be able to set a variable to state that 5 documents were found.
Any ideas how to do this?
Cheers
Marc
I currently writing a ksh script but i'm stuck.
Example of what I'm trying to do.
find . -name "*.doc" -print
or
ls -ltr ¦grep .doc ¦awk '{print $9}'
either way this will list all documents in the current directory that have extensions ending in .doc.
What I want though is to find out how many instances of .docs there are from the generated list as above. So if the list brings back 5 .docs I want to be able to set a variable to state that 5 documents were found.
Any ideas how to do this?
Cheers
Marc
Thread
Thread Starter
Forum
Replies
Last Post
Karlos
Computer & Technology Related
9
10 March 2002 03:23 PM