v_chandra
24th October 2005, 14:24
Hi

I have a session where in 2 file path are mentioned of which first is import path and file name and second is archieve path, once the data is imported from the file mentioned in import path, i have to move the file to the path mentioned in archieve path with some prefix.

Actually i will have to pass 3 values with that shell script ie. import path, archieve path and the prefix, so could any one give me the syntax of how to call shell script from program script by passing parameters to it.


Thanks in Advance.

v_chandra

PeterH
24th October 2005, 15:17
This is how I solved your problem:

hulp.name = file.name(1;5)

file.from = path.unix & "/" & file.name
file.to = path.unix & "/archive/" & hulp.name & "." & hulp.ext
h.ret = file.cp(file.from, file.to)
if h.ret = 1 then
input.file = file.to
verwerk.input.file()
h.ret = file.rm(file.from)
endif

Peter.

mark_h
24th October 2005, 15:50
If you baan program already knows the paths and name then use like Peter mentioned. No need to execute a shell script. But below is a method to call shell scripts:

| build the cmd.
cmd = sprintf$("somecmd.ksh %s %s %s",import.path,import.name,archive.path)
|execute the command
ret = shell(cmd,SHELL_NO_OUTPUT)

v_chandra
26th October 2005, 08:57
Thanks a lot for the solution, i will try and check both the solution.

Thanks and Regards