×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Thanks for the input on this.
I’ll go try these out and see what will work for me.

Thanks!


On Apr 15, 2022, at 6:57 PM, Scott Klement <midrange-l@xxxxxxxxxxxxxxxx> wrote:

Hi Jay,

I was thinking along the same lines as Jack... you've probably got a different version of 'ls' in your PATH or something.

I also notice that your 2nd example includes the full path vs. just the file name, which also seems to indicate you are picking up a different version of ls.

The default mode in 'ls' is actually to print multiple files per line. If you want just one per line, most 'ls' utilities have a -1 (that's the number 1) switch that can be passed that means "one per line".

So try it like this:

qsh cmd('cd /home/jvaughn/.ssh && ls -1A')

Since it's listing the current directory, it's less likely to give you the paths. And the -1 explicitly tells it to only include one per line. (-1A is -1=one per line, and -A=include hidden files.)

Also, FWIW, I don't recommend using OVRDBF FILE(STDOUT) in a production program. It's fine for a one-off or just messing around, but... if it's a "real" program, consider piping the output to Rfile to write it to a PF, or use a redirect to write it to a stream file.

-SK


On 4/15/2022 1:55 PM, Jay Vaughn wrote:
I'm trying to figure out why 2 different IBM i's produce different stdout
outputs...
system1
OVRDBF FILE(STDOUT) TOFILE(QTEMP/DIRLIST)
OVRSCOPE(*JOB)
OPNSCOPE(*JOB)
qsh cmd('ls -A /home/jvaughn/.ssh')
SRCSEQ SRCDAT SRCDTA
.00 0 xyz_rsa_prv
.00 0 xyz_rsa_pub
.00 0 abc_rsa_prv
.00 0 abc_S_rsa_pub
******** End of data ********
output nicely per row in qtemp/dirlist
system 2
same steps above but...
SRCSEQ SRCDAT SRCDTA
.00 0 /home/jvaughn/.ssh/STOREPORT_rsa_pub
/home/jvaughn/.ssh/i
.00 0 /home/jvaughn/.ssh/id_rsa
/home/jvaughn/.ssh/known_h
******** End of data ********
2 files per row instead of 1...
tia
Jay
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.