Using Linux I have a bash script to build a lot of app progs but it has an issue, but first the script :
#1st load the copybook pathexportCOBCPY=/home/vince/cobolsrc/oe/src/copybookforiin`ls*.cbl`;docobc-m$i-Wlinkage-T$i.prn;echo"Compiled "$i;done
This find all files with extension of .cbl and compiles them BUT it also sets up the print file as progname.cbl.prn
How do I change this script to give print files as progname.prn
I did think there was a ls switch that would just give the name without the extension but does not seem to do this, next was, is there a way of using grep, but again no such feature.
It is driving me nuts trying to find what I suspect is a simple fix :(
Any one with a solution say within the for i in `ls etc ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
and of course, if you use that more regularly, use a Makefile.
With GC 3.2 you can (again) use -MT to also generate a dependency file, so if one copybook changes make would compile (all and only) the COBOL sources that use that.
Last edit: Simon Sobisch 2023-08-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry the tic marks are not cut and pasting correctly. Did not see that...
This is one I have on your compile line and it works, but there are TIC marks (the ` to the left of the number 1 key) before the echo and after the last sed single qoute.
for i in ls *.cbl; do cobc -m $i -Wlinkage -T $i.prn; echo "Compiled " $i;mv $i.prn echo $i.prn | sed 's/cbl.prn/prn/'; done
It is still not putting the tic mark there I will send it to you in email...
THIS part should have a tic mark before the e in echo and after the last single qoute. I will put a caret there instaed but change it to tic.
^echo $i.prn | sed 's/cbl.prn/prn/'^
Using Linux I have a bash script to build a lot of app progs but it has an issue, but first the script :
This find all files with extension of .cbl and compiles them BUT it also sets up the print file as progname.cbl.prn
How do I change this script to give print files as progname.prn
I did think there was a ls switch that would just give the name without the extension but does not seem to do this, next was, is there a way of using grep, but again no such feature.
It is driving me nuts trying to find what I suspect is a simple fix :(
Any one with a solution say within the for i in `ls etc ?
Or, during compile, change the output of a your sub-shell
ls, or do that when referencing it (nowadays, prefer$(...)over `...`:and of course, if you use that more regularly, use a Makefile.
With GC 3.2 you can (again) use
-MTto also generate a dependency file, so if one copybook changes make would compile (all and only) the COBOL sources that use that.Last edit: Simon Sobisch 2023-08-26
Try this:
While you are in the directory that has the * . cbl.prn files
Last edit: Mickey White 2023-08-26
That crapped over all *.cbl file over writing o/p from the .prn reports.
I will have to rebuild all of the programs.
On 26/08/2023 20:03, Mickey White wrote:
Sorry the tic marks are not cut and pasting correctly. Did not see that...
This is one I have on your compile line and it works, but there are TIC marks (the ` to the left of the number 1 key) before the echo and after the last sed single qoute.
for i in
ls *.cbl; do cobc -m $i -Wlinkage -T $i.prn; echo "Compiled " $i;mv $i.prnecho $i.prn | sed 's/cbl.prn/prn/'; doneIt is still not putting the tic mark there I will send it to you in email...
THIS part should have a tic mark before the e in echo and after the last single qoute. I will put a caret there instaed but change it to tic.
^echo $i.prn | sed 's/cbl.prn/prn/'^
Last edit: Mickey White 2023-08-26