Shell Script

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
whitneje
Posts: 9
Joined: Wed Dec 27, 2006 1:36 pm

Shell Script

Post by whitneje »

Is it possible for macros to work with a shell script? I am trying to make a simple script like the following:

REM copy source destination
copy %1 %2
exit


I want %1 = c:\*.*
I want %2 = c:\Archive%YYYYMM%\

If I put those values in place of %1 and %2 then the %YYYYMM% just disappears. If I use params the macros in the destination don't get translated. What am I missing?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

I am affraid, Schell script in unable to resolve macro variables in the script's body. However, if enabled "Translate macros" option, you may use global macro variables as script parameters. http://www.ks-soft.net/hostmon.eng/mfra ... m#udvmacro

In fact, you may use date & time macro variables as script parameters either. You just should specify correct macro variables. In your case, you have to pass c:\Archive%YYYY%%MM% as parameter. Please, do not forget to enable "Translate macros" option.

Regards,
Max
whitneje
Posts: 9
Joined: Wed Dec 27, 2006 1:36 pm

Post by whitneje »

Thanks, I was missing the inner %% between YYYYMM when I was trying to pass it in as a parameter.
Post Reply