× 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.



This may be a question that only Scott can answer.

Given the following string

/bin/tr '|' \n < /home/alanc/test.txt > /home/alanc/test2.txt

which works from the command line in qsh I want to call the spawn api in
an RPG/ILE program.

The spawn API expects that the 5th parameters be an array of null
terminated strings with the parameters.

My question is given the above string, how many null terminated strings
would I send?

Three?

'''|'' \n'
'< /home/alanc/test.txt'
'> /home/alanc/test2.txt'

Four?

'''|'''
'\n'
'< /home/alanc/test.txt'
'> /home/alanc/test2.txt'

Six?

'''|'''
'\n'
'<'
'/home/alanc/test.txt'
'>'
'/home/alanc/test2.txt'

I keep getting the following errors:

QP2SHELL Error Log

Run Date: 5/08/07 Time: 19:59:57 User:


tr: 0653-712 The combination of options and String parameters is not
legal.

Usage: tr [ -c | -cds | -cs | -ds | -s ] [-A] String1 String2

tr { -cd | -cs | -d | -s } [-A] String1

I know there is trick. I just cannot figure out what it is.

The code can execute other commands without a problem but it just
doesn't like this one.

Thanks for the help.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.