|
On Feb 8, 2020, at 4:28 AM, Patrik Schindler <poc@xxxxxxxxxx> wrote:
Hello Duane,
Am 07.02.2020 um 23:44 schrieb Danner, Duane <ddanner@xxxxxxxxxxxx>:
Is there a way to have a cl check the folder and if there is a file that starts with %BMOCOM then rename it to CLRBMO.TXT
Not with CL but with qsh, you can pick up the first filename and rename like this:
cd /path/in/ifs; mv `ls -1 '%BMOCOM'* |head -1` CLRBMO.TXT
Please note that in the example above the backticks are essential. These are in function like braces in mathematics: The expression within will be evaluated first and replaced by the evaluated value.
My Example is very crude because,
- it doesn't check if the destination file already exists and blindly overwrites,
- it takes only the first file (to suppress errors if multiple files with a similar name exist).
Pack this into a qsh call and it will do what you need.
(Tested successfully in qsh V4R5 :-) )
:wq! PoC
PGP-Key: DDD3 4ABF 6413 38DE - https://www.pocnet.net/poc-key.asc
--
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@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
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.