ADSM-L

Re: max line length

2000-08-30 15:48:26
Subject: Re: max line length
From: Richard Sims <rbs AT BU DOT EDU>
Date: Wed, 30 Aug 2000 15:48:32 -0400
>From dsmc command prompt on unix os, using a dsmc selective statement, what
>is the maximum length of a line?

My ADSM.QuickNotes addresses that under the exemplary item:

Archived files, delete from client      Via client command:
                                        'dsmc Delete ARchive FileName(s)' (q.v.)
                                        When there is a large number of files to
                                        be deleted, you simply can't specify
                                        them all on a single command line
                                        because of Unix command line limits (the
                                        ARG_MAX value in
                                        /usr/include/sys/limits.h, which results
                                        in the shell error "arg list too long").
                                        Various Unix commands (especially 'tar')
                                        allow you to specify "-" for the input
                                        filename such that the command will read
                                        Stdin for the input list, which you can
                                        then redirect or pipe.  And many provide
                                        a command line option like "-f ..." for
                                        specifying a file containing the list of
                                        names.  But not the *SM clients, alas.
                                        The best alternative for Unix is:
                                         - Create a file containing all the
                                           filenames. One filename per line is
                                           great.
                                         - Invoke the *SM command line client
                                           under the Unix 'xargs' command...
                                           xargs dsmc delete archive
                                                 < YourListOfNamesFile
                                           where the file containing the list of
                                           filenames is redirected to Stdin.
                                        You could first try it on a 'Query
                                        ARchive' to get comfortable.
                                        The xargs command deals with the limit
                                        on the number of arguments possible on
                                        the command line by splitting over
                                        multiple invocations of the specified
                                        command, avoiding excessive command line
                                        length.

  Richard Sims, BU
<Prev in Thread] Current Thread [Next in Thread>