Passing parameters to shell command within a MAXL script

Hi all,
we are trying to run the following from MAXL console
MAXL> msh script.msh 100 c:\t.txt
where script.msh has the line:
shell 'echo $1 >> $2'
we are looking to add a line with text "100" to the file C:\t.txt but it's actually creating a file called $2 with the text "$1" within it.
How can we workaround it?
Thanks

If I understood well you command line, we would have .log and .err files but .err would be also redirected to .log apart from .err, right?^^^Exactly. That way you can look at either stream, or both. If you think about it, you could test for the existence of any .err file (or come up with your own unique extension for that directory) and flag that after the fact with an email, and attach the specific error and the overall stream. Mind you, given the size of your files, you might want to zip them down first.
It's the best (or, depending on your outlook, the worst) of all worlds.
Scripting is one of those things that isn't very sexy, and when it's done well it just fades into the background and doesn't get the credit it deserves. But when it blows up or is kludgy beyond compare it makes everyone's life miserable.
Regards,
Cameron Lackpour

Similar Messages

  • Passing parameters from shell script to OWB process flow

    Hi all,
    I am running OWB process flow (using the template script provided by oracle) and i want to pass two date parameters as shown below:
    sqlplus -s $SQL_USER/$SQL_PWD@$ORACLE_SID @$HOME_DIR/src/vmc_oem_exec_script.sql OWB_OWNER VMC_POST_DW_PF_LOC_SIT PROCESS VMC_NM1_PORT_MAIN "," "P_DATE_FROM=$DATE_FROM,P_DATE_TO=$DATE_TO"
    How do i catch those values in process flow and pass those to mappings in Process flow?
    Do i need to create PF variables with same names or any name will do?
    Thanks in advance

    This document is explaining how to pass data between activities in process flow.
    I am passing parameters from a shell script.
    Any ideas,how to pass parameters from shell script and then initialize the process flow variables based on those values and then pass them further to mappings.
    Thanks

  • Invoking shell command within XSLT?

    Is it possible to invoke shell commands within XSLT? Something like
    <code syntax="python">print(1+2)</code>
    and generate
    <code>3</code>
    or something like that? A newbee here ;-)
    Last edited by xanb (2014-07-11 12:27:20)

    I don't think xslt itself can call external interpreters.  Xslt can do the calculations and even conditionals, but if you want to use python, or other interpreters, you'd need some sort of "preprocessor" step.
    Depending on your actual goals, you may be interested in the various "literate programming" tools.  I don't know of one of the top of my head for having scripting languages embedded in an xml document, but it wouldn't surprise me if there were some.  Most of the ones I know are for embedding various code (C, R) in (La)Tex documents.  I use Sweave daily which is a latex document with R code that the R interpreter processes first to replace with the results, then the latex tools make the final document.
    EDIT: This may be of interest.
    Last edited by Trilby (2014-07-11 12:35:00)

  • Passing parameters with spaces to SCCM Run PowerShell Script task

    I am working on an OS deployment task sequence in SCCM 2012 R2 with several Run PowerShell Script tasks.  Most of them run fine, but I am having trouble with the one I need to pass parameters to.
    The parameters I need to pass are:
    -ComputerOU "ou=All Workstations,dc=contoso,dc=com" -GroupDN "cn=Group1,ou=All Groups,dc=contoso,dc=com"
    I have that line (with actual DNs) entered in Parameters of the task.
    But when the script runs on the target machine, the values of the parameters in the script are truncated at the spaces.  $ComputerOU is set to "ou=All" and $GroupDN is set to "cn=Group1,ou=all"
    What syntax should I be using the Parameters field of the Task in order to properly pass PowerShell parameter string values that include spaces?
    Tim Curwick
    MadWithPowerShell.com

    Thank you, TC, but I am not calling the parameters from within PowerShell.
    The parameters are in the settings of a task sequence task to be used by the task to launch a script.  The syntax I am using would be correct for use within PowerShell or from a command line or batch script, but SCCM appears to be doing some parsing
    before or while it is passing them to the script, possibly dropping the quotes which causes mishandling of the spaces in the string values.
    Historically, it is always challenging to give one application parameters to pass to another application, and the required syntax can get quite tricky when the two application handle quotes or spaces differently, or when the parent application wants to parse
    something intended to be passed on as is to the child application.
    I'm sure someone has already figured out what the syntax needs to be for doing this with an SCCM 'Run PowerShell Script" task, it's just one of those issues that is hard to Google effectively.
    Any other ideas?
    Tim Curwick
    MadWithPowerShell.com

  • Executing a shell command within vi using aliases

    The behavior of the ksh ENV environment variable has been changed in Solaris 10 and I assume it is related to the reason why I can no longer use aliases when using the "bang" (!) command execution in vi. For a very simple example, if ll were an alias for ls -lFbo entering this in vi:
       :!llwould produce the expected "ls -l" listing of the current directory in previous Solaris versions. Why does this not work in Solaris 10 and is there an alternate way to accomplish the same thing?

    I don't know exactly but the code written below is working fine try the same with your code .Even with your code instead running the code with
    " ./<filename> ",if you execute it with "sh <filename>" command without changing the mode of the file it is executing properly.
    import java.io.*;
    import java.util.*;
    public class ScriptBuilder
    public ScriptBuilder()
    public void writeScript() throws java.io.IOException
    FileWriter writer = new FileWriter(new File("test_script"));
    writer.write("#! /bin/sh\n");
    writer.write("ll>/home/faiyaz/javaprac/checkll");
    writer.flush();
    writer.close();
    Runtime rt= Runtime.getRuntime();
    rt.exec("chmod 777 test_script");
    rt.exec("./test_script");
    } public static void main (String[] args)throws java.io.IOException
    ScriptBuilder sb = new ScriptBuilder();
    sb.writeScript();
    }

  • How to pass parameters to a page invoked using java script.--- Very Urgent.

    Hello,
    I have an advanced Table in my page. In the first column there is a
    messageChoice. In the second column there is link item.On the link item i have set the following value for destination uri.
    javascript:var a=window.open('OA.jsp?page=/AutoSales/oracle/apps/per/auto/webui/AutoSurrogatesPG&retainAM=Y','a','height=500,width=900,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbar=yes'); a.focus();
    The user selects a value from the message choice and when he clicks on the link item, the value selected from the list should go to the new page invoked using java script as a parameter. I need the value selected from choice to generates few fields in the new page. I have preferred java script because i need the base page and a model window should open. I have tried using setForwardUrl() and setting '_blank' and new window for target frame property on the link item. But it isnt working. The new page is opening in the same window.
    I have also tried putting the value in a session.
    Please help with any kind of suggestions or solutions.
    Thank you.

    Uma,
    You need to
    - Have a PPR Action on the messageChoice (this would trigger a form submit to populate the underlying View Attribute)
    - Either
    - Retrive the value from the View Attribute in the pop-up page (as I could see that you are retaining the AM)
    - Use a SPEL in the link (on the modal page) to use the value from the View Attribute as the parameter value (in the form ${oa.current.<ViewAttributeName>)
    HTH

  • MaxL with DATAEXPORT and passed parameters

    Have a MaxL script that is passed four parameters.
    Within the MaxL script I am executing a DATAEXPORT calculation, not a calc script.
    I want to use some of the parameters as part of the output filename. I have tried various combintaion of single quotes, double quotes, backslashes, etc. on the output filename but can't seem to come up with the right combination. Always seems to produce ERROR - 1242021 - (11) Syntax error near....
    Any ideas, suggestions or am I wasting my time on this one?
    Thanks,
    Tom
    System 9BI+ running on Windows
    /* ===========================================================================      */
    /* : Required Parameters      */
    /* : $1 - ID      */
    /* : $2 - password      */
    /* : $3 - app name      */
    /* : $4 - db name                                        */
    /* ===========================================================================      */
    login $1 $2 on 'localhost';
    execute calculation
    'SET DATAEXPORTOPTIONS
    DataExportLevel "LEVEL0";
    DataExportRelationalFile ON;
    DataExportOverwriteFile ON;
    DataExportDynamicCalc OFF;
    DataExportColFormat ON;
    FIX("CY2010");
    DATAEXPORT "File" "," E:\Hyperion\AnalyticServices\app\$3\$4\CY2010Data.txt "#MI";
    ENDFIX;'
    on $3.$4;
    spool off;
    logout;
    exit;

    Hi,
    I don't think the DATAEXPORT command likes parameters but there is a way around it, it does accept a substitution variable for the whole path and filename.
    If you create a sub var (in my example I have already created one called "ExpFile") then in your maxl script you can set the variable with the full path and filename and then call the subvar in the DATAEXPORT command
    You could do it with something like
    login $1 $2 on 'localhost';
    alter system set variable ExpFile "&#92;"E:&#92;&#92;Hyperion&#92;&#92;AnalyticServices&#92;&#92;app&#92;&#92;$3&#92;&#92;$4&#92;&#92;CY2010Data.txt&#92;"";
    execute calculation
    'SET DATAEXPORTOPTIONS
    DataExportLevel "LEVEL0";
    DataExportRelationalFile ON;
    DataExportOverwriteFile ON;
    DataExportDynamicCalc OFF;
    DataExportColFormat ON;
    FIX("CY2010")
    DATAEXPORT "File" "," &ExpFile "#MI";
    ENDFIX;' on $3.$4;
    logout;
    exit;
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Passing parameters to the reports server

    Query on passing parameter from URL to the report server and then to the graphic report builder. We are able to pass the parameter from URL to the report server but we don't know the way of passing this parameter from report server to the graphic bulder or
    writer module. We do not know the API call for passing the same from report server to
    the graphic builder.

    Can you tell me how to pass parameters to report server within URL.Thanks!

  • Power Shell Command using CSOM

    Hi,
    We have prepared a Power Shell command using Client Side scripts as per client requirements. The client did not had access to the SharePoint Server. So, PS commands with
    server side scripts was out of scope. 
    The client requirement was to delete all the permissions on the list that was being inherited from site. Since the number of users were huge, so deleting all the users using ribbon was not possible.
    Please have a look at the scripts below and let me know your feedback. If you have better suggestion than this, please let me know.
    #location of client dlls on users' local system
    $loc = "C:\SharePoint\ClientDLL" 
    //SharePoint Site URL
    $siteUrl = "" 
    #Write your Login ID
    $loginname = "" 
    #Write the Name of the List
    $listname = "" 
    Set-Location $loc 
    Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.dll")
    Add-Type -Path (Resolve-Path "Microsoft.SharePoint.Client.Runtime.dll") 
    Write-Host "Please enter password for $($siteUrl):"
    $pwd = Read-Host -AsSecureString
    $ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) 
    Try
    # Remove or replace line below to change authentication method
    $ctx.Credentials = New-Object System.Net.NetworkCredential($loginname, $pwd) 
    $web = $ctx.Web
    $ctx.Load($web)
    $ctx.ExecuteQuery() 
    #Write-Host "Current web title is '$($web.Title)', $($web.Url)"  
    $list = $Web.Lists.GetByTitle($listname); 
    $ctx.Load($list); 
    $ctx.ExecuteQuery(); 
    Write-Host "Deleting Permissions on List : $($list.Title)" 
    if($list.HasUniquePermissions)
                    #Write-Host "Has Unique Permissions"
                    $list.ResetRoleInheritance()
                    $list.BreakRoleInheritance($false, $true)
                    Write-Host "Permissions deleted" -foregroundcolor Green
    if(-not $list.HasUniquePermissions)
                    #Write-Host "Does not has Unique Permissions"
                    $list.ResetRoleInheritance()
                    $list.BreakRoleInheritance($false, $true)
                    Write-Host "Permissions deleted" -foregroundcolor Green
    Catch
                    Write-Host "Some Error, Please Contact Administrator" -foregroundcolor Red
                    return
    $list.Update() 
    $ctx.ExecuteQuery();​
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    Hi Sudheer,
    In Client-Side, we can also use .NET Client Object Model to achieve your requirement.
    Remove permission in Sharepoint List using Client Object Model
    https://rambabualaparthi.wordpress.com/2013/12/30/remove-permission-in-sharepoint-list-using-client-object-model/
    In order to better manage SharePoint in Client side, I suggest develop a Winform or WPF application and use .Net Client Object Model to achieve some requirements.
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • MAXL Script for copying outline

    Can we write any MAXL Script for copying outline from one aplication/datbase to another application/database.
    Example copying olt from app1.dbb1 to app2.dbb2

    No and yes.
    There is no MaxL statement for copying an outline from one DB to another (Unless you are converting from BSO to ASO). But you can shell system commands like xcopy within a MaxL script (of course you could just do this in your batch or shell script) . Just make sure you stop the Dbs before doing the copy

  • Shell script calling SQL Program and passing parameters

    Hi guys,
    Greetings from Toronto. Is it possible to pass a string or strings as parameters to a sql program from a shell script ?
    Shell Script
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    SQL Program (rd_test.sql)
    -- Accept system input parameters
    define p_user_id = &1
    define p_job_id = &2
    -- Wondering if its possible to pass these 3 parameters from a shell script program.
    -- (1) rd_test-$p_job_id-3-1.lis
    -- (2) RD_PRINTER(rd_test,3)
    -- (3) t_data
    select
    t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    t_data_dir=''.''
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'
    exit_status=$?
    check_command'
    from rd_job_parameter b, rd_job_parameter a
    where a.job_id = &2
    and a.jp_module_id = 'RDTEST'
    and b.job_id = a.job_id
    and b.module_id = a.module_id
    /As always, its not something I have to solve this minute. Any help would be appreciated
    and I will be thinking of the problem.
    Thanks
    Raj
    Edited by: Raj404261 on Jun 25, 2009 11:40 AM
    Edited by: Raj404261 on Jun 25, 2009 5:29 PM

    Hi Sean,
    Thanks for the reply. I am not at work yet. I already do have the if condition to call 2 separate sql scripts. I was hoping them to be reduced to one sql script. That's why I was hoping to pass some of those values to the select statement as parameters.
    Here is what I was hoping to pass from the shell script based on an IF condition. The good thing about it is that I can hard code these 3 parameters in the shell script in the IF and ELSE conditions. Is it possible to tag these 3 hard coded values in the command line after $p_job_id and then capture these 3 parameters in the SQL program ?
    1. rd_test-$p_job_id-3-1.lis or rd_test-$p_job_id-3-1.lis
    2. RD_PRINTER(rd_test,3) or RD_PRINTER(rd_test,4)
    3. t_data=''rd_test-'||'''$p_job_id'''||'-1-1.txt''
    Shell script :
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    if [condition]
       sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    else
       sqlplus.exe -s $p_user_id @$RD_PATH/rd_test.sql $p_user_id $p_job_id
    fi
    ksh $RD_PATH/another_shell_prog.sh $p_user_id $p_job_id '||a.rd_value||' '
    ||b.rd_value||' rd_test-$p_job_id-3-1.lis $RD_PRINTER(rd_test,3) '||
    '$t_data $t_data_dir'||'

  • Problem in passing parameters in command line in desktop

    Hi,
    I am trying to generate reports from command line (Oracle Discoverer 4i Version 4.1.42.04.00) but I am facing problems when I try to pass date or numeric parameters. It seems to work with strings
    The following command is successful when i pass string as parameters
    C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb load_report_1 /batch /sheet 2 /parameter "P Date" "31-JUL-2006 Month End" /export xls c:\Temp\load_report_!
    But in the following commands the command line execution stops when a worksheet with parameters is encountered. Once then parameter is entered the command line is executed successfully. In these problem cases it seems like the /parameter option is not being recognized. I have tried to pass parameters with double quotes, single quotes, without any quotes.
    C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb "load report 2" /sheet 3 /parameter "Select P Day" "20-JUN-2006" /batch /export xls c:\Temp\load_Report_2
    C:\orant\DISCVR4\dis4usr.exe /connect reports/reports@orcl /opendb "load report 3" /batch /sheet 1 /parameter "Enter Date Using Format YYYYMMDD" 20060703 /export xls c:\Temp\load_report_3
    The only difference I can see is that I have not used double quotes in the command line that is successful in generating reports with parameters.
    Any inputs will be appreciated - we are stuck in our project due to this issue. Many thanks.
    Warm regards
    Sucharita

    Hi
    I work in the same team as the original poster.
    We tried by changing NLS_DATE_FORMAT for the oracle_home.
    Just to clarify our issue I am describing it one more time below -
    Using Disc desktop (4.1.42) we are trying to run the reports using command line interface. Any report that takes character input for the parameters ,is running fine in the batch mode without prompting.
    Any report that takes Date/Numeric input for the parameters, though in batch mode, is prompting for user to give the parameters.We tried with quotes as well.
    For Example -
    1. Character input : when we run this command supplying the input parameter values (which are characters), report runs fine without prompting for values.
    C:\orant\DISCVR4\dis4usr.exe /connect rep/rep@orals /opendb Schd_Report /batch /sheet 2 /parameter "Process Date" "31-JUL-2006 Month End" /export xls c:\audit_report_5
    2. Date Input -
    C:\orant\DISCVR4\dis4usr.exe /connect rep/rep@orals /opendb "DLS.Arrears Reports" /batch /sheet 1 /parameter "Please Enter Date Using Format YYYYMMDD" 20060703 /export xls c:\CA_arr
    When we submit this we get a window prompting for the input values. So his is the issue.
    Thanks
    Raman

  • Passing Parameters within a DPS App

    I have a DPS App with 2 slots. One slot contains embedded code which is suppose to show a list of assets. One slot contains code that launches an external site in a frame within the DPS app. 
    As per this article New Consumer Marketing APIs | Adobe Developer Connection, it is possible to pass parameters from an external app to a DPS app.
    I am running an issue. In my external site I am trying to call the DPS app like so dpsapp://v1/slot/storefront?path=/content/test.pdf via a button.  What I have noticed is that when I do that, the app does switch to the storefront side but queryingthe urlPath or urlQueryString will return a null value.
    It seems like I am unable to pass a parameter to the DPS app within the same app. If I load the external website in Safari, I am able to query for the parameters.
    Am I missing a step here or is it not possible?
    Thanks

    Hi,
    Do you use the adobeDPS.configurationService.applicationContext.urlQueryString to call the parameter? adobeDPS.configurationService.applicationContext.urlQueryString
    //Sample code to get a parameter from the query string, com.adobe.CustomDPSViewer://v1/slot/store?companyName=Adobe
    var companyName = adobeDPS.configurationService.applicationContext.urlQueryString.companyName;
    alert(companyName); //Alert box will appear with 'Adobe' in the description
    Adobe DPS - Library and Store SDK 2.32 : adobeDPS-ApplicationContext : JsDoc Reference
    What is the Adobe DPS version of your app?
    Cheers
    Mike

  • Execute shell command from within pascal code

    Hello there,
    I am trying to execute a shell command from within my pascal code. I use XCode together with FreePascal. I have tried something like:
    exec ('program', 'options');
    adding the 'Dos' unit to the Uses clause of my program.
    Thus, e.g.,
    exec ('mkdir', '/A')
    to create a directory with the name 'A'.
    However, my attempts so far were unsuccessful. Can anyone help me on this, and perhaps provide a simple example of how to do it right?
    Thank you in advance,
    Shane

    In the mean time, I found the problem myself. I am just posting the solution here for anyone that is interested. My original solution was correct, in that the 'Dos' Unit must be added, and that the right command is 'exec'. There was however a problem with the correct path to the program that I wanted to invoke. In the shell, this program was accessible from anywhere. However, in the 'exec' command, the full path to the program must be given. Since I am not a Unix expert, I don't know the reason for this.
    So, in summary, the solution is:
    Uses Dos;
    begin
    exec ('full path to program', 'program options');
    e.g.: exec ('/bin/sh', '/run.sh') to process the commands in the file /run.sh
    end
    Hope this may be of help to anyone else.
    Shane
    Mac OS X (10.3.9)
    Mac OS X (10.3.9)
    Mac OS X (10.3.9)

  • Pass parameters (fs command) between tabs on a Infoview

    Hi,
    Could I pass parameters (fs command) between tabs on a Infoview dashboard?
    Tkank you.

    hi fadrielli,
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/8082c807-ec9a-2d10-b28e-eaef69416592
    open the address and read the article.it gives the complete information regarding the content linking between the dashboards using FScommand.
    thanks and regards,
    ravi kishore.

Maybe you are looking for

  • Help-incomplete library shows up when I use the remote to play iTunes

    I bought a new iMac a few months ago and have enjoyed the luxury of being able to control the music in iTunes via the remote control from across the room. This morning, however, when I tried to do this, I found that only a small portion of the music

  • Howto - Using apache and mod_php4

    This is a quick tutorial on how to use the apache web server with the php module.  I am by no means an expert, so if you have any questions/suggestion, please feel free.  That being said, let's get started: 1.  Install apache and php: [root@limbo roo

  • ISE(identity services engine) Compatability with 4400 Controllers

    We have mixture of wireless controllers in our environment consisting of Cisco 4400 and 5500 series wireless controllers.  We are in the early stages of piloting Cisco's Identity Services Engine.  I am trying to get clarification if it is fully compa

  • Partion an image into parts

    hi   does anyone have any ideas on how to split a single image into multiple parts and making each part a control. All I need to do is show a single image on the front panel and capture the event depending on which part of the image the user clicked.

  • Setup a simple sales funnel with exchange 2013 public folders and outlook 2010 -2013

    BCM for Outlook is big and has too many choices. What we want is a combination of contacts and tasks within a public folder so we can see what others are doing. If possible I want to make a connection between an contact and a task. The task should ha