× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello,

The way I'd typically do this from a command line in a *nix environment (including QSH) is by using the 'xargs' command. xargs bascially takes a base command and then reads input arguments from stdin and keeps adding them to the base until the maximum shell command length is reached. It will then execute the command and start the process again by reading more arguments from stdin.

Let's assume that the command length limit is two arguments. If 'ls' returns:

one
two
three
four

then 'ls | xargs echo' would run two commands:

echo one two
echo three four

xargs works great if you need to pass a list of filenames or similar, but if you have more complicated requirements for argument logic then it can get tricky or impossible to get your desired results through this method. As always, YMMV.

t.

On 23-Oct-2007, at 2:34 PM, David Gibbs wrote:

bill.blalock@xxxxxxxx wrote:
"Does a script processed by qsh have a limit on the length of a command?
If so what are the tricks to get around it? (continuation or whatever)"

I've run into limits on what the Windows 2000 command processor in terms
of length of the command. I was wondering what limits are on a qsh
command, particularly one built in a script.

Sorry, this I cannot answer.

Perhaps someone else has more experience in qshell?

david

--
System i ... for when you can't afford to be out of business
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.