Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi There.
I am running a unix script that ftp's into an as/400 i-series server and downloads files into a unix filesystem. These files are all suffixed with .DZ12504 which I think is the file definition format. The files look something like this: total 612
-rw-rw-rw- 1 root sys 20249 Nov 9 11:16 PBS1109A.DZ12504
-rw-rw-rw- 1 root sys 279476 Nov 9 11:16 PBT1109A.DZ12504
-rw-rw-rw- 1 root sys 12697 Nov 9 11:16 PBU1109A.DZ12504I would like to find out how I can globally change the .DZ12504 suffix to .txt. Bear in mind that there could be up to 11 files at a time. Once the files have been changed to reflect the .txt suffix SAP will then read these files and update the SAP database with this info. I have looked at sed , cat and mv but don't what the best option is. Could you please assist. Warm regards

for x in *.DZ12504
do
mv $x `echo $x|sed "s/\.DZ12504/\.txt/g"`.txt
doneJust a guess, can't validate exactness here ;)

![]() |
command output running
|
subtract single value usi...
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |