What I want to achieve
- User would provide a command which would do remote execution. Command (protocol for remote execution) can be SSH/RSH... etc. So I want it to be part of a configuration file or a template file (assume parameters are fixed across protocol) like below sample -
template.cfg file (as configured by user):
ssh $ip $commandList
I would generate a list of values in another data file which would contain the ip address and the command list. Like
10.182.215.214|echo $UNAME 10.251.142.142|echo $SHELLNAMEI would like to have a script call it
driver.shwhich when executed, generates the actual script/scripts with the command from template to another execution script -execute.sh
Questions
- How can I generate the script based on template/plugin (which can take liberty and provide the command)?
- If the data is generated in an online application (C/C++), other than normal file based operation (read from the cfg file and update the
execute.sh) is there any better way?