Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Directory Help

 
SOLVED
Go to solution
jjinva
Advisor

Directory Help

VMS 7.3-1. I have a requirement to find all files with same exact filename without the extension. For Example: In my directory
I have error.com, error.lis, error.rep.

I need some incantation of dir that will return just error. as you see no extension.

Is there a such a parameter?
8 REPLIES 8
Duncan Morris
Honored Contributor

Re: Directory Help

Hi Jjinva,

what you should try is

dir error.

note the trailing full stop

you can see specific versions with

dir error.;-1

etc


Duncan
Hein van den Heuvel
Honored Contributor

Re: Directory Help

I'm not sure what you mean, but I am sure there is no option for DIRECTORY to get there.

Do you just want to drop the versions and show just 1 copy with no version?

$ pipe dir *.*; | perl -pe "s/;\d+//g"

Note, the ";" after the filespec is critical to report a single (the highest) version.

1 file per line, or columns?

$ perl -le "print foreach ()"


1 name, no extention, no version per 'group'?

$ perl -le "$names{(split /\./)[0]}++ foreach (<*>); print foreach (sort keys %names)"

Why do you need the particular output?
What problem are you really trying to solve?
Maybe we can help better know that!


Hope this helps some,
Hein van den Heuvel (at gmail dot com)
HvdH Performance Consulting
Jon Pinkley
Honored Contributor
Solution

Re: Directory Help

This appears to do what you are asking for

$ dir/col=1

Directory ROOT$USERS:[JON.DIRECTORY_TEST]

ABC.1;2
ABC.1;1
ABC.2;1
ABC.3;1
DEF.TXT;1

Total of 5 files.
$ pipe dir *.*; /select=(file:(nonode,nodev,nodir,notype,nover)) /nohead/notrail | sort sys$pipe sys$output /nodup
ABC
DEF
$
it depends
Robert Gezelter
Honored Contributor

Re: Directory Help

jjriva,

Yes, DIRECTORY/COLUMN=1 *.; should do it. If you are building this list for further processing, the /NOHEAD and /NOTRAIL parameters may be of use.

- Bob Gezelter, http://www.rlgsc.com
jjinva
Advisor

Re: Directory Help

John,

Thank you. That does exactly what I was looking for.
jjinva
Advisor

Re: Directory Help

Sorry , I meant Jon.
Hoff
Honored Contributor

Re: Directory Help

I'd probably look to use f$search and f$parse here, depending on the specific requirements. Parsing output works for this case, but there are alternatives.

In a loop...

f$search("ddcu:[dev]ERROR.*",1)

gets the file

then f$parse to extract the filename from the full specification.

There are almost certainly examples of this DCL file-processing loop around the 'net.

jjinva
Advisor

Re: Directory Help

Answer found thread closed. Thanks for all the replies.