And(&&) Question

Hi,
for example in this script I want both of these files to be listed with my "ls" command but it won't work, is there a way to do it like this I've tried &, ||, |, etc.
This seems so simple but I can't figure it out.
I thought with "&&" it would work but I was wrong!

#!/usr/ksh

touch class.doc note.txt
ls doc && note

Thanks,

A

Try:

ls .doc note

If your shell script is executing from the same directory as class.doc note.txt you can just do a:

ls class.doc note.txt

I think I didn't make myself perfectly clear.
I start again with a better example

#!/usr/bash

touch report.txt booby.doc report.doc
ls txt report

You see if I use you command(I've tried this before) I will have 3 outputs when I only want 2.
Because there should only be 2 outputs -
But report.txt gets printed out twice I need it to only print out once.

Thanks again,

A

Then why not do

ls report*

Your output will be: report.doc report.txt

Maybe I dont understand what you are trying to achieve...

I still didn't make it as clear as I should of:
How about this!

#!/usr/bash

touch report.txt booby.doc report.doc run.txt report.cpp
ls txt report

See this will ls 4 report files when in fact there is only three! I don't want any files duplicated!
I need this for my dir with many files not just these listed - if that helps.

Thanks,

A

Your Question is very interesting!
There might be better solutions, but I thought of :
ls `ls report* *.doc | uniq`

or if you want ls -l :
ls -l `ls report* *.doc|uniq`

Hope that helps!

Hezki

Thank you very much everyone, especially "me2unix".

I've been trying to figure out this command for a while now.
Good stuff!
Where would we be without the net,
I love the internet!

Thanks a lot again,

the-A