Computing.Net > Forums > Unix > Scripting Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Scripting Problem

Reply to Message Icon

Name: beejay
Date: November 9, 2009 at 06:39:53 Pacific
OS: HPUX
Product: Hpux / Rx7620
Subcategory: General
Comment:

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

I 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



Sponsored Link
Ads by Google

Response Number 1
Name: tvc
Date: November 9, 2009 at 09:27:33 Pacific
Reply:

for x in *.DZ12504
do
mv $x `echo $x|sed "s/\.DZ12504/\.txt/g"`.txt
done

Just a guess, can't validate exactness here ;)


0
Reply to Message Icon

Related Posts

See More


command output running subtract single value usi...


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Scripting Problem

scripting problem (HELP!!!) www.computing.net/answers/unix/scripting-problem-help-/5360.html

Shell script problem www.computing.net/answers/unix/shell-script-problem/4434.html

Scripting problem www.computing.net/answers/unix/scripting-problem/6932.html