Hello
I posted on here a while ago about processing multiple files within a script.
See original post below:
I have a program cfxfrwb which is designed to remove headers from reports files.
The cfxfrwb is located in the following directory /u01/efin/v40/live/bin
I run the program against a single report file in the temp directory and it does it's job.
./cfxfrwb /home/efin/efintran/temp/cli_r02r0051.prt
I'd like to run the ./cfxfrwb against several report files.
I modified a script I found on the web but it doesn't seem to work
#!/bin/bash
FILES=/home/efin/efintran/temp/*
for f in $FILES
do cfxfrwb
echo "Processing $f file..."
# take action on each file. $f store current file name
cat $f
done
I'd be grateful if someone could offer some assistance.
Many thanks
The problem was solved by using the following:
#!/bin/bash
FILES=/home/efin/efintran/temp/*
for f in $FILES
do
/u01/efin/v40/live/bin/cfxfrwb $f
echo "Processing $f file..."
# take action on each file. $f store current file name
We have recently upgraded our systems and my script has stopped working again. We have different file paths.
The cfxfrwb program will work if it runs against files individually
for example /u01/efin/v42/live/bin/cfxfrwb act_r09r3817.prt ...this processes the file act_r09r3817.prt as expected and removes it's header.
when it is executed within the script it returns an error:
Removing headers from report files \n
./efdsx_trans: line 209: 18443 Segmentation Fault (core dumped) /u01/efin/v42/live/bin/cfxfrwb $f
Processing /export/home/efin/efintran/temp/act_r09r3814.prt file...
We have discovered that the cfxfrwb program will only work when the environment has been set. I have looked at the settings within the environment and included them in my script but it still returns core dump errors.
Anyone have any ideas?
Many thanks