CA Client Automation

 View Only
  • 1.  DMS scripting - Execute command on Linux

    Posted Oct 03, 2019 12:21 PM
    Hi all,

    New DMS scripting question from me.
    When running Execute commands against Windows, the convention seems to be "cmd /c <details of command>" as a format.

    Is there some guidance on executing Linux commands - do they need a shell prefix or anything else, or is the command entered 'clean'?

    E.g. if I just want to run an ls command:-

    Execute("ls")
    Execute("sh ls")
    Execute("bash ls")

    Kind regards,
    Bob.

    ------------------------------
    Never trust a man who when left alone with a tea cosy doesn't try it on.
    ------------------------------


  • 2.  RE: DMS scripting - Execute command on Linux
    Best Answer

    Posted Oct 03, 2019 12:35 PM

    Hi Bob,

     

    Unfortunately I've had little experience running 'execute' functions in Linux, I've done it but many years ago for one project I can think of. In any case I think the reasons to do so would be the same. To be clear, it's not necessary to use the 'cmd /c' convention, there are two primary reasons I do it:

     

    • Many of the commands I use from scripts are CADSMCMD 'batch' commands, which often require an environment variable (set sdcmd_continue=on) to be set first so it continues if there are errors, so I execute 'cmd /c sdcmd_continue=on&&cadsmcmd ...' to run both commands in the same environment.
    • I use a redirect (> or >>) frequently to save the output of my commands to a file either for logging purposes or for further processing.

     

    In some cases my scripting examples may include 'execute' functions which call 'cmd /c' even though they don't fit either of the scenarios above. This is simply because I've become used to using that method. I suppose in such cases I'm wasting some resources by spawning an unnecessary shell.

     

    Steve McCormick

     

    Hi all, New DMS scripting question from me. When running Execute commands against Windows, the convention seems to be "cmd /c <details of... -posted to the "Clarity Client Automation" community

    Broadcom

    Clarity Client Automation

      Post New Message

     

    DMS scripting - Execute command on Linux

    BOB LOMAX

    Oct 3, 2019 12:21 PM

    BOB LOMAX

    Hi all,

    New DMS scripting question from me.
    When running Execute commands against Windows, the convention seems to be "cmd /c <details of command>" as a format.

    Is there some guidance on executing Linux commands - do they need a shell prefix or anything else, or is the command entered 'clean'?

    E.g. if I just want to run an ls command:-

    Execute("ls")
    Execute("sh ls")
    Execute("bash ls")

    Kind regards,
    Bob.

    ------------------------------
    Never trust a man who when left alone with a tea cosy doesn't try it on.
    ------------------------------

      Reply to Group Online   View Thread   Recommend   Forward   Flag as Inappropriate  



     

     

    You are subscribed to "Clarity Client Automation" as stephen.mccormick@fiserv.com. To change your subscriptions, go to My Subscriptions. To unsubscribe from this community discussion, go to Unsubscribe.

    Copyright © 2005-2019 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

    Hosted by Higher Logic, LLC on the behalf of Broadcom - Privacy Policy | Cookie Policy | Supply Chain Transparency | Terms of Use