|
*-L* Both symbolic links on the command line and symbolic links encountered in the tree traversal are followed. The file information and file type returned for each symbolic link is for the file referenced by the link. If the referenced file does not exist, the file information and type will be for the link itself.
On Fri, 16 Apr 2004, Patrick L Archibald wrote:
I use the Qshell commands "find" and "fgrep" to search java source files for a string. It spawns a bunch of QP0ZSPWT jobs. Is there any environment setting or some other setting to stop it from spawning all these QZSHSH jobs?
Here is an example of the Qshell command:
QSH CMD('find -L ''/java'' -name ''*.java'' -exec fgrep -il
''sompflm000'' {} \;')
I tried this from the qsh command prompt on my system:
find /home -name "*" -exec fgrep -il "printf" {} \;
Then I checked WRKACTJOB and found 3 jobs running related to the find command. Interesting because on linux the exact same command results in just one process. However, I didn't have the multitude of jobs you describe, just three. Still, three is more than one, and initially I expect there to be just one.
However, the -exec argument to find fires off fgrep, so that is technically two commands. So I guess I would expect to see two jobs in WRKACTJOB for the find command in this case. Reviewing WRKACTJOB when the find command finished, two of the jobs went away, leaving me with just the shell job. This made me remember that linux is the same way -'ps ax' show my shell running as tcsh. And chances are good that the find command ran fast enough on linux that I didn't catch the grep process running.
Furthermore, find should fire off an fgrep for each file it finds, so it makes sense that there would be a job for each file found. Checking 'ps ax' again on linux shows this:
30766 pts/1 S 0:00 -tcsh 2140 pts/1 S 0:00 find /usr/src -name *.c -exec fgrep -il printf {} ; 3166 pts/1 R 0:00 fgrep -il printf /usr/src/linux-2.6.3/drivers/char/ft
So in fact there are three processes for the running find command. This matches what I saw on the iSeries and is the expected behaviour.
If you see more than three jobs for the find command, it could be that find is starting an fgrep job, and not waiting around for it to finish before finding the next file and starting another fgrep job.
The -L argument is interesting. It is not a valid argument on linux. Perhaps leaving it off makes a difference?
James Rich
Zvpebfbsg vf abg gur nafjre. Zvpebfbsg vf gur dhrfgvba. AB (be Yvahk) vf gur nafjre. -- Gnxra sebz n .fvtangher sebz fbzrbar sebz gur HX, fbhepr haxabja _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.