- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: DCL Pipe Question
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 12:06 AM
тАО12-13-2007 12:06 AM
DCL Pipe Question
ls -1 | xargs rm
I tried to do
pipe dir/columns=1/noheading/notrailing | delete
This doesn't work - it gives me a missing command parameters error.
Can someone tell me why?
Regards
Patrick.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 12:29 AM
тАО12-13-2007 12:29 AM
Re: DCL Pipe Question
arguments from stdin/SYS$INPUT any more than
"rm" does. You've omitted the "xargs" from
the VMS version.
DELETE already has the usual raft of file
selection options: wildcard lists, /BEFORE,
/SINCE, and so on. Do you really need to use
DIRECTORY for anything here? DCL does not
work exactly the way a UNIX shell works, so
the best way to solve a problem in one
environment is seldom the best way in the
other.
Or is there some real problem which you are
trying to solve?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 12:36 AM
тАО12-13-2007 12:36 AM
Re: DCL Pipe Question
Most DCL commands do not work in the same way as U**x commands do. The DCL command DELETE expects one parameter, a file specification. It also accepts an indirect specification in the form of @
So you might be able to do the following:
pipe dir/columns=1/noheading/notrailing | delete @sys$pipe
However, when I tried it, it deleted only the first file from the pipe and then issued the message
%DCL-W-NOCOMD, no command on line - reenter with alphabetic first character
I will try to find out why.
Regards,
Bart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 12:52 AM
тАО12-13-2007 12:52 AM
Re: DCL Pipe Question
> specification. [...]
Not necessarily one. As the HELP says:
DELETE
file
Parameter
filespec[,...]
Specifies the names of one or more files to be deleted [...]
> I could not find documentation about this,
> though.
http://h71000.www7.hp.com/doc/83FINAL/9996/9996pro_18.html
It's in the fine print:
[...]
To execute a command procedure that contains qualifiers or parameters, or both, for a specific command line,
place the @ command where the qualifiers or parameters normally would be in the command line. Then specify
the name of the command procedure file containing the qualifiers or parameters.
[...]
> I will try to find out why.
DIRECTORY doesn't put out a comma-separated
list of file specs, which is what you'd need
here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 01:57 AM
тАО12-13-2007 01:57 AM
Re: DCL Pipe Question
DELETE filespec[,...]
The pipecommand doesn't create a parameterlist, just a list of files.
The first attempt with just DELETE,
says "missing command parameters" and as it says....no parameters is supplied.
The second attempt with "DELETE @SYS$PIPE".
SYS$PIPE is still a list of files, not a parameterlist. The first file (line) is executed, but the next line in the file will be executed as it is.....without any command.
Take a look on "@" in "DCL Dictionary"
=======
To execute a command procedure that contains qualifiers or parameters, or both, for a specific command line, place the @ command where the qualifiers or parameters normally would be in the command line. Then specify the name of the command procedure file containing the qualifiers or parameters.
If the command procedure file begins with parameters for the command, the @ command must be preceded by a space. For example:
$ CREATE TEST.COM
TIME
[Ctrl/Z]
$ SHOW @TEST
14-SEP-2001 17:20:26
If the file begins with qualifiers for the command, do not precede the @ command with a space. For example:
$ CREATE TEST_2.COM
/SIZE
[Ctrl/Z]
$ DIR@TEST_2
Directory WORK$:[SCHEDULE]
JANUARY.TXT;8 14-DEC-2001 15:47:45.57
FEBRUARY.TXT;7 14-DEC-2001 15:43:16.20
MARCH.TXT;6 14-DEC-2001 11:11:45.74
.
.
.
Total of 11 files.
If the file contains parameters or qualifiers, or both, do not begin the lines in the file with dollar signs. Any additional data on the command line following @filespec is treated as parameters for the procedure.
======
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 05:03 AM
тАО12-13-2007 05:03 AM
Re: DCL Pipe Question
What aboout a simple command procedure (XARGS.COM):
$ open/read pipe sys$pipe
$loop:
$ read pipe args/end=end
$ 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8' 'args'
$ goto loop
$end:
$ close pipe
so you can do:
$ pipe dir/columns=1/noheading/notrailing | @xargs delete
or perhaps
$ pipe dir/columns=1/noheading/notrailing | @xargs delete /confirm
Its a one minute command procedure so its on you to test it and improve
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 05:58 AM
тАО12-13-2007 05:58 AM
Re: DCL Pipe Question
OpenVMS pipes are not what you remember from Unix; you'll probably get frustrated pretty quickly here. Many of the OpenVMS DCL verbs aren't set up for nor particularly suited for piping, either. The usual solution is lexical functions, something which OpenVMS has a reasonable set of.
Why not load gnv and do what you want, and the way you want to? gnv provides bash and related, and gives you a reasonable emulation of and the tools of the Bourne shell. And gnv is free, and is provided by HP.
Stephen Hoffman
HoffmanLabs LLC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 05:59 PM
тАО12-13-2007 05:59 PM
Re: DCL Pipe Question
Consider doing a $ help lexical. It gives you a list of Lexical Functions available in DCL. One of them is F$CONTEXT. With this, you can do various things like search for files in a directory. You can use a delete command in a loop. I know that isn't as slick as using a pipe command, but it works. The lexicals are pretty cool, so check 'em out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-13-2007 08:15 PM
тАО12-13-2007 08:15 PM
Re: DCL Pipe Question
A fine suggestion.
>> One of them is F$CONTEXT.
Correct.
>> With this, you can do various things like search for files in a directory.
NOT. You can use F$SEARCH for this though, with or without the help of its CONTEXT argument, and with or without the help of F$PARSE.
Patrick> DCL Pipe Question
>Question In a naive attempt to replicate
>ls -1 | xargs r
>I tried to do
Why? Just to try? What problem are you really trying to solve?
fwiw, I would use PERL to do something along the lines requested. For example:
$ pipe dir /col=1 *.tmp | perl -ne "chomp; unlink if /;/"
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-10-2008 10:38 AM
тАО01-10-2008 10:38 AM
Re: DCL Pipe Question
> ls -1 | xargs rm
> I tried to do
> pipe dir/columns=1/noheading/notrailing | delete
> This doesn't work - it gives me a missing > command parameters error.
:-D
On my VMS V7.3-2 system with GNV V1-6.2, the following worked just fine:
$ bash
bash$ ls -1 | xargs rm
bash$
$
But I guess that using GNV to answer this question is cheating!
I also found that the following worked:
$ DELETE *.*;*
:-D
(Please note the smilies!)