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



I am attempting to do renames in an IFS folder using a wildcard pattern. The native IFS commands to not seem to allow wildcards, so I adapted this from a tip published by Ted Holt.

The code is:
QSH CMD('cd /usr/Mark/Downloads/;for file in *.n37;do mv "$file" "$(basename $file n37)h37";done')

It was taking a long time, so I pared it down to this statement as a test:

QSH CMD('cd /usr/Mark/Downloads/;for file in *.h37;do ls "$file";done') from the command line.

There are 54 entries out of 56 (plus . and ..) that match the pattern. It took over 1/2 minute to display the first entry. The entire run took about 14.5 minutes. So it's averaging 25-26 seconds per entry. This is on a lightly utilized v7r3 Power8, that is quite fast for most other operations.

1) Can someone explain what it's doing for it to take so long?

2) I assume there's a much better alternative. I'm looking for ideas to do this with a minimal amount of code.

TIA.

-mark

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.