Dear Unix guru's,
I have a SUSE linux variant with SAP running on it. From SAP it is possible to call UNIX commands, like the shell with parameters.
We have several of these systems, like a development system (DEV), a test system (TST) and a production system (PRD).
I have created a shell-script that works, but it references the machines in a hardcoded way. So my scripts work on PRD but not on DEV. For example, some datafile that I must work with in my script is located in directory:
/interface/PRD/in
Unfortunately it is company policy to have the system name in the directory tree.
One rule of my script (as an example) looks like this:
cp /interface/PRD/in/* /interface/PRD/work
Now I would like to have PRD as a variable so that would become:
cp /interface/$1/in/* /interface/$1/work
In this manner I can copy the scripts from one machine to another and they can still run. However, the parameter $1 for the script should be filled based on the content of a file: sysid.cfg which will contain one line only with the value DEV, TST or PRD. I can generate such a file from my SAP system.
Any suggestions on how I can do this?
(PS: I am not a UNIX guy, so please use plenty of explanation in your answer...
)