the if...then logic is going ot execute in the shell of the target system for an external command or pre/post commands. so /bin/sh on *nix and cmd on windows.
since sh and cmd have different if...then syntax, this won't really work.
so what does the external command look like, because i'd think that will be affected by the shell issue as well?
thanks for your quick reply.
however, im not sure if i understood.
what im trying to do, is to write pre-command, that will suit for both unix and windows. in this pre-command i will ask the target machine if it works on windows or unix. according to the answer that i get (using the "if"), i will know to run the sh or the bat files, in the command itself.
is it possible to do so?
right, but the pre-command has to run in a shell somewhere. it runs in a shell on the target system. the shell will be either cmd or sh.
it's probably easier to have 2 blpackages.
im not sure that the target machine will have a shell... can i do this asumtion ?
(u dont mean "network shell", right?)
every OS has a shell. on *nix it's bash or sh or ksh or tcsh or whatever. on windows it's 'cmd'.
any of the 'external commands' or 'pre/post-install' commands are executed in whatever is the default shell on the target system, so on *nix it will be /bin/sh, on windows it will be 'cmd'.
because of that, any actual commands you put into the 'external command' or 'pre/post' need to be able to run in the shell of the target system. so something like:
[ $foo = "hello" ] && echo hi
will work on a *nix system, but will fail on a windows box because the if..then structure is different in sh and cmd.
so there is no cross-platform way to perform the check.
the easiest way would be to have 2 packages, one for *nix and one for windows.