PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07/30/2015 10:51 AM by  R Wayne Walker
Windows DOS script
 7 Replies
Sort:
You are not authorized to post a reply.
Author Messages
This_Guy
Private
Private
Veteran Member
(225 points)
Veteran Member
Posts:93


Send Message:

--
12/02/2010 10:59 AM
    I need to replicate my KSH scripts from our Unix machine to our new Windows and cant seem to get it to work.

    I had to gut most of the syntax but I still cant get this 'basic' importdb script to work > Tokendef, etc... any help or expertise?

    It doesnt like mypath cariable, or some of the if-then-else sytax..

    Its attached in zip format...
    Attachments
    Kwane McNeal
    Private
    Private
    Veteran Member
    (1215 points)
    Veteran Member
    Posts:405


    Send Message:

    --
    12/02/2010 11:23 AM
    If you're running Lawson on Windows, you have to use a POSIX emulation layer. You have ksh available to you either way.

    Since you don't say which UNIX platform you are coming off of, I can only give you general information, but here goes:

    IF you are using MKS, the ksh is solid standard ksh88, and does what you'd expect from more UNIX builds (particularly AIX and Solaris)

    IF you are using SUA (nee Interix), the ksh is a bit kludgey, because it is actually PDKSH. For this, I tend to use a static compiled version of ksh88 (so I don't have to mess with the cygwin silliness).
    For ksh93 on SUA, use the following: http://blog.fpmurphy.com/2010/10/po...7-sua.html

    I looked at it, and it seems to be the right way to go.

    In short, you should NOT have to do much of anything to port your scripts, since they should run standard.

    Now with all of that said, if you must port them, you need to port them to PowerShell, NOT to bat/cmd scripts. The command set isn't there, and if your scripts do anything of substance, you will not be succesful at replicating them.

    The history is that command.com was designed in essence to be a cross of CPM (for compability), and simplified sh commands (for UNIX familiarity). This is because Microsoft was at that time a UNIX reseller (ala XENIX). Therefore the intent was that command.com was SUPPOSED to NOT be able to support complex commands such as {k|ba}sh, since it would have eaten into the lower end of Microsoft's other baby at that time...XENIX

    Hope this helps, and educates.

    Kwane
    954-547-7210
    John Henley
    Private
    Private
    Senior Member
    (9596 points)
    Senior Member
    Posts:3216


    Send Message:

    --
    12/02/2010 11:55 AM
    What version of Windows? Are you using LUU or MKS? If MKS, what version?

    Specifically, it looks like your script contains a hybrid of shell script syntax combined with Windows batch file syntax.  It needs to be one or the other--can't really mix them.  If you are using ksh syntax, you would use $LAWDIR not %LAWDIR%.  For batch file syntax, it's %LAWDIR%.  Fun, huh?

    As Kwane says, you should be able to run your UNIX shell scripts pretty much unaltered on your Windows box as long as you're not doing anything crazy.  That said, I have seen some issues with scripts not working with older versions of MKS (9.1/9.2) on Windows Server 2008.
    Thanks for using the LawsonGuru.com forums!
    John
    ichiben
    Private
    Private
    Advanced Member
    (59 points)
    Advanced Member
    Posts:21


    Send Message:

    --
    12/02/2010 12:55 PM
    You should be able to use cygwin  and convert them fairly easily.  Most of them probably won't need adjusting. http://x.cygwin.com/

    http://x.cygwin.com/">cygwin
    R Wayne Walker
    Application Developer
    Nemours
    New Member
    (6 points)
    New Member
    Posts:2


    Send Message:

    --
    07/30/2015 10:10 AM

    Old thread, new problem... sorry if this is already answered somewhere else or not the way to proceed on a thread; however, I having the same or similar problem and so far Lawson/Infor has been little help.

     

    First, how can I determine the environment in LID?

    It is being hosted on Amazon AWS, Windows as specified by Infor, but beyond that I'm clueless... except for the information I've found on this and other user support sites.  How does one identify the shell?

    I do (I think) understand the concept of "lashell", but having difficulty getting the reference or user guide information I need.  I read about LUA(?) and MKS(?) but do not know how to determine which I may have ... or cygwin?  It seems like it is cygwin... but MS DOS seems to work too... (vi command.exe?).

     

    I am trying to develop batch or command line interpreter scripts, and integrate with tokendef and jobdef.

    Perl too... we use perl and need to invoke from a job and/or a script (.bat or .cmd ??? ) and I tried the "start" and "cmd" in tokendef and it only hung up... just specifying the file name seems to work.

     

    i.e. "Command   D:/mydefault/login/directory/doodahdoodah.bat" (without the quotes).

    Any help would be greatly appreciated!

     

     

    Greg Moeller
    Private
    Private
    Veteran Member
    (3879 points)
    Veteran Member
    Posts:1379


    Send Message:

    --
    07/30/2015 10:43 AM
    Try commands like set or set in LID. One or the other (possibly both) should bring back your environment variables for that session.
    Greg Moeller
    Private
    Private
    Veteran Member
    (3879 points)
    Veteran Member
    Posts:1379


    Send Message:

    --
    07/30/2015 10:45 AM
    env or set
    R Wayne Walker
    Application Developer
    Nemours
    New Member
    (6 points)
    New Member
    Posts:2


    Send Message:

    --
    07/30/2015 10:51 AM
    Set works... "env" used to work, but doesn't now.
    I was also able to redirect to a file, which at first I couldn't, strapped down privileges ya know... :-(
    I do see the environment variable "SFUDIR=C:\Windows\SUA\" and others referring to "SUA", so I guess we
    have an SUA versus MKS unix like environment? Not sure if that helps, but may... still need to develop "scripts" of some kind, to copy or move files and send emails if possible. It was doable under AIX/ksh and using perl... but this has been a real struggle. Thanks for the advice though!
    You are not authorized to post a reply.