I would like to replace a "." with timestamp.
Constraint : I am making use of an existing shell script(called by a C program ) which reads the sed command from a properties file.I cant use/pass variables
Line in C program - $(echo ${filename} | sed "$TRANSFORM" $TRANSFORM is populated using the line in properties file as below
You say you can't use/pass variables and then you show us code that passes the shell variables filename , TRANSFORM , and, presumably, variables that will correspond to the input , Output , and Expected output fields in your configuration file.
If you have this line: $(echo ${filename} | sed "$TRANSFORM" in your C program, your C program will not compile. Shell command substitutions, pipelines, and variable expansions are not valid in a C program. Even if the calling program is a shell script instead of a C program, the command substitution is incomplete.
There are no quotes in your configuration file. There is no way for a C program or a shell script to delimit the value that is supposed to be assigned to the shell variable TRANSFORM .
The Output format in your configuration file contains two decimal points that appear to be literal characters. The Expected output contains one decimal point. How can these two possibly produce the desired results?
Whoever created this "C-program calling B-script reading properties file" must have documented their ideas on its usage and structures. What's in this documentation? Did this ever work?