[Solved] Start a background process from within a loop?

What I'm trying to do is this:
for i in $(seq 3); do
sleep $i &
done
but bash doesn't like the one-line version:
[foutrelis@foutboxd ~]$ for i in $(seq 3); do sleep $i &; done
-bash: syntax error near unexpected token `;'
Halp?
Last edited by foutrelis (2008-09-20 17:23:23)

The '&' after the sleep command is the termination of the command, so you don't need the extra ';'
$ for i in $(seq 3); do sleep $i & done
See the section "Lists" under "SHELL GRAMMAR" near the top of the bash man page.
Last edited by jcasper (2008-09-20 17:19:13)

Similar Messages

  • How to start a GP process from a url within EP?

    I know how to start a GP process from the webdynpro url generated from the instantiation tab of a GP process.
    But if I use this url, the end-user will be prompted with a login screen to authenticate to the J2ee server because it's a webdynpro url and it doesn't recognized that the user is already logged in the Portal.
    How can i avoid this login screen or how can I get a Portal url that launch the GP process directly? Thanks, Andre

    Hi Austin,
    There is a strange problem when creating a web dynpro with the URL parameters. It web dynpro window pops up a new portal window in which the process is displayed. Rather, if I create a URL iView of the form http://<host>:port>/webdynpro/dispatcher/sap.com/cafeugpuiinst/AInstantiation?process.template.id=<...>&process.autostart=t it works fine!
    I'd like the web dynpro iView to work cause otherwise I'll have to add static sapcssurl parametes for the theme etc. which I want to avoid.
    Regards,
    Nirav

  • Problem in Starting a GP Process from Webdynpro Code

    Hi Experts
    I have a problem in starting a GP Process from webdynpro code. I have imported the following used DCs in my Webdynpro DC
    caf/eu/gp/api/wd
    caf/eu/gp/api (external)
    com.sap.security.api.sda
    Once I deploy I get the following error. No Syntax, Build errors in the application.
    java.lang.NoClassDefFoundError: com/sap/caf/eu/gp/process/rt/api/IGPRuntimeManager
    I have used the following code to start the GP Process - getUserDetails Context is of type IUser
              //Starting GP Process
    try {
    IGPRuntimeManager rtm = GPProcessFactory.getRuntimeManager();
    IGPProcessRoleInstanceList roles = rtm.createProcessRoleInstanceList();
    IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(
         wdContext.currentContextElement().getUserDetails());
    IGPProcess process = GPProcessFactory.getDesigntimeManager().getActiveTemplate(
                        "00A897714C5A11DE8E33005056A260C3", userContext);
    IGPStructure params = GPStructureFactory.getStructure(process.getInputParameters());
    IGPProcessInstance prInstance = rtm.startProcess(process,
                        "New User Registration Process",
                        "New User Registration Process",
                        wdContext.currentContextElement().getUserDetails(),
                        roles,
                        params,
                        wdContext.currentContextElement().getUserDetails());
    } catch (Exception e) {
         e.printStackTrace();
    Please do the needful EXPERTS.
    FYI... SP17
    Thank you
    Best Regards
    Ramamoorthy D

    Hi Ram,
    You have to add Library reference to your DC.
    in the context menu of your DC select
    properties->webdynproReferences->LibraryReference
    add sap.com/cafeugp~api as refernce.
    I hope this will solve your problem.
    Regards,
    Rajesh

  • Start a BO report from within a web-application.

    Hi,
    An enuser want to start a BO report from within a web-application.
    The BO report ideally should not prompt for a login. The fact that we are using BO for reporting purposes should be transparent to the end users. The report should produce its output directly in Excel (pdf?) format. In WebI i can do a 'Save As' to obtain this, but it should go automatically so that the end users get their response directly in Excel
    the report should be parametrized. These parameters will be added to the URL by the calling application.
    To do a basic test of the Opendocument.jsp i created a number of test reports in WEBI, and i use the following URLs to execute them directly
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=tmsd1&sType=rep&sRefresh=Y
    http://s-olaf-vtst150:8080/OpenDocument/opendoc/openDocument.jsp?&sPath=[My reports]&sDocName=Yearselection&sType=rep&sRefresh=Y&lsSYear:=2002
    So this covers points 1 & 4
    What are the options for points 2 & 3?
    Kind regards,
    Johan

    The BO XI 3.1 environment works quite well now.
    Two more questions:
    1. When a user being member of the Readers group, still sees the Edit button in Webapplication - Infoview. Is it possible to hide or disable that Edit button ?
    2. Is it possible to make a user only seeing a part of the data in the universe ? When a query is run with a parameter, the user ses the parameter in the left column ... but in that way a normal user can change the value of that parameter giving him the possibility to see things he should not see. Making a separate query per user is overkill and too much work to do. Is BO XI 3.1 able to offer this possibility and how ?
    Rgds,
    Johan

  • Start a WS application from within a java program

    Hi,
    I need to start a WebStart application from within a java program. Therefore I develeoped a class which starts javaws.exe within its main-method like this:
    try {
    Runtime.getRuntime().exec(
    "c:\\java web start\\javaws.exe http://a.b/c.jnlp"
    } catch (Exception e) {
    e.printStackTrace();
    And that did not work. Java Web Start tries to start the .jnlp program but returns with the message, that the app-desc|applet-desc|installer-desc|component-desc is missing. But it is there: It is an applet and thus I defined an applet-dec.
    I tried to do it from a command line with the followinf command:
    java -Djnlpx.home="C:\abc" -cp "C:\abc\javaws.jar" com.sun.javaws.Main http://a.b/c.jnlp
    And that works. But using this command from within my jjava prog using the Runtime.exec() method does not work.
    By the way, simply type "javaws http://a.b/c.jnlp" at the command line does not work.
    Can anybody help me? How may I start a .jnlp program within another java program.
    Kind Regards,
    Tobias Neubert

    Hi,
    I recently had a quite similar problem. At least the error message by the Java Web Start application on Mac OS X complained about the same error (app-desc|applet-desc|installer-desc|component-desc). It turned out to be some bad invisible characters in the jnlp file. I copied some sample from a web page which for some reason contained some unicode chars that the parser doesn't like. Use a different text editor or the less command on unix to see if there are some strange characters in you jnlp file.
    But it seems strange that it does work from the command line and not from your code.
    -Stefan

  • Starting a CAF process from UWL?

    Hi Guys,
    I can see list of workflow items from R/3 in my UWL in Portal. Now I want to start a CAF process from the workflow item and not any R/3 workflow. Is it possible? If yes how can it be done? I've referred to documents explaining how to call a BSP or MiniApp  or WebDynpro  for ABAP , but that is not my requirement.
    Any inputs/ pointers are welcome and would be rewarded suitably
    Thanks in advance.
    Best Regards,
    -Vaibhav

    Hi,
    Check this blog on Netweaver workflow capabilities,
    Workflow in SAP NetWeaver
    Hope this helps !
    Regards
    Srinivasan T

  • HT204350 Started the transfer process from my old MacBook to a new MacBook pro using Migration assistant 12 hours ago. The screen says transferring your information. Moving about 270 GB using an Ethernet cable  directly connected. Is this normal?

    Started the transfer process from my old MacBook to a new MacBook pro using Migration assistant 12 hours ago. The screen says transferring your information. Moving about 270 GB using an Ethernet cable  directly connected. Is this normal?

    You can get a thunderbolt to firewire adapter. You can then get a firewire 400 to 800 cable and put the old computer in target mode. Then you can follow these instructions.
    http://support.apple.com/kb/HT4889
    Choose migrate from other disk or volume.

  • Launch background process from unix command line and detect if it is runnin

    in Cocoa, I am able to run unix app by using NSTask, it works fine to me. But I want to do the following:
    1. Start up a background process.
    2. Wait to see if this background process has been launched correctly.
    3. If yes, keep running following codes...
    With NSTask, I cannot make sure when the background process has been launched correctly... and other codes just keep running...
    If I do something like:
    while (bgprocess isRunning)
    }

    What exactly do you mean by "launched correctly"? Do you just care that the process has begun? Do you want to make sure it is still running? Do you want to see if there is some signal emitted (either affirmative "I am running" or absence of a child-died signal)?
    Your isRunning example does appear to be in accord with the NSTask docs for "do blah blah blah while the task is running", but that doesn't seem to be what your description says you want to do. Is "blah blah blah" an idle loop until the task has started, or is it something to do while the task is actually running?
    How about looking up the pid of the child process (processIdentifier for the NSTask) and then check whether that process is still running?

  • Creating a Step for Background Job from within ABAP Program

    Step-1: I have a Report in ECC, which is scheduled as Background Job, which writes the file to the Application Server(UNIX)
    Step-2:  Trigger a Unix Command to ftp the file to other server.
    Both Step-1 & Step-2 can be done from SM36. 
    Another Scenario:
    Users can run the report in background from SE38 or using the transaction code for the report, In this case we want to call the external command.
    Instead of calling the External Command as below in the report, I want to create a Step from within the program when it is scheduled in background mode.
    CALL 'SYSTEM' ID 'COMMAND' FIELD lc_unixcom.    [ Here lc_unixcom has the External Command ].
    Any ideas??? Appreciate help.

    Hi,
    For submitting a report step, you may use either SUBMIT ... VIA JOB ... or JOB_SUBMIT function module.
    For external commands, this should be done only by calling JOB_SUBMIT function module.
    Sandra

  • Need to start JINI registrar instance from within the code

    HI All,
    I need to write JUnits for our app using JINI for which we need to start JINI registrar from within the code and then publish some services to it.
    Any idea how we could be starting the JINI registrar from Java Code ? Any thoughts/suggestions/pointers would be highly appreciated.
    Thanks in advance
    Vikram

    Hi Senthil,
    You can directly call the outer class method. Otherwise use the following way MyDialog.this.close(); (But there is no close() method in Dialog!!)
    If this is not you expected, give me more details about problem.
    (Siva E.)

  • How to start a BPM process from ERP system

    Hi,
    I created a process in Netweaver Developer Studio with the Process Composer in SAP CE 7.1 BPM, now I want to automatically start the process by saving a SAP document like purchase requisition or purchase order. Therefore I think about implementing a UserExit / Badi or something else.
    The following systems are available in my Landascape:
    - PI 7.1
    - ERP 2005
    - CE 7.1 EHP1 with ESR
    Does someone have an idea how to start the BPM Process or how to trigger start event?
    Greetings,
    Christian

    the process by saving a SAP document like purchase requisition or purchase order.
    Based on your business process, you will have to decide what data should be sent to other system. It could be in the form of Idoc trigger or an RFC calls. If there are non-SAP systems involved, you should be using PI 7.1 too. In that case, you can communicate using Abap proxy call too. For this you may either call an RFC internally in a report and schedule it.
    Regards,
    Prateek

  • Starting a quicktime movie from within flash?

    Hello,
    I am very new to flash and would like to know if this is
    possible? I have a flash template that I am using for a business
    card CD. I would like to have a jpeg image (within the flash
    template) act as a button that when pressed opens a full screen
    quicktime movie. Is this possible from within flash? Would it make
    a difference if I export everything to a quicktime movie? If flash
    can't do this would there be a 3rd party software that would enable
    me to do this? Any suggestions or options would be much
    appreciated!
    Regards,
    Kevin

    Hi,
    This you can achieve via Interactive Adobe forms.
    Refer this [Link|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50d1cb99-46cf-2b10-8880-85004a301283].
    Regards,
    Surjith

  • Start host process from within guest OS

    I am using VMWare Workstation 10.
    Some of my vm's are dedicated to compiling code using CruiseControl.NET.
    What I am attempting to do is add a step that automates testing a completed setup on several clean virtual machines. From what I can see, the guest OS will be required to 'announce' to the host OS that a build has completed and then launch a process to revert the virtual machines, start the virtual machines and then launch a process that does the following:
    Copy the setup.exe from a known location to a directory on the virtual machine
    Launch the setup.exe with parameters from a command line
    Wait for setup.exe to finish
    Launch an automated testing tool to validate basic functionality of the application.
    Wait for automated testing to complete
    Shut down the virtual machines
    Wait for next successful build
    I am attempting to work on this problem using vmrun.exe within a powershell script. With this script I can successfully revert virtual machines, start and stop virtual machines.
    What I am trying to work out is how to pass data from CruiseControl.net in the guest operating system to the host operating system. So I am turning to this community to see if anyone here has any ideas?
    I have not read of any ideas of communication from the guest to the host while there is a 'host' <yeah, pun is intended> of information of sending info from the host to the guest. Note that the guest OS does not have VMWare Workstation installed, nor is it desirable to do this.
    My initial thoughts, even as I write this question, is that all of the guest OS build machines map a drive to the host. At the end of of a successful build the setup is copied to a directory and a sentinel file is updated with information. The host OS will have CruiseControl.net installed and will monitor for file changes for the sentinel file. When changed then it will start the automated testing process.
    Is there a better way to accomplish this goal?
    I appreciate any suggestions.
    Sincerely,
    Dan Lee | Release Engineer

    >I guess I was expecting VPC to work like Remote Desktop, where you would automatically see the host drives listed in Windows Explorer ("C on hostname", "D on hostname", etc).
    It really should, but there's a RDP update that messes up this
    functionality.
    >Edit 2: I've just set up a mapped drive, but it seems very unreliable. It gets slower and slower as I "drill down" through folders on the host, and right-clicking a file to copy it to the guest causes Windows Explorer to hang, and never
    shows the context menu. I've tried uninstalling IS from the guest and re-installing/enabling it, but it made no difference. Thoughts?
    Turn of all TCP and UDP offloading in the NIC properties on the host. Not
    all NIC's are fully compatible on that feature.
    Bob Comer Microsoft MVP -- Hyper-V

  • Start a new process from a running process BPM 10.3 STUDIO!

    Is it possible to create a process in BPM Studio 10.3 from a running process.
    The scenario is that we have a process running listening to a jms queue an when a message
    arrives it's starts the process that was requested in the in message.
    /Getr

    if you have a Global Automatic activity listening to a JMS queue, here's how you can create a new work item instance in a process using logic in the Global Automatic activity's method. This uses the "Fuego.Lib.ProcessInstance.create()" method shown below:
    // "args" is an associative string array (Any[String])
    argsIn as Any[String]
    // this assumes that the Begin activity has two argument variables
    //   named "nameArg" and "amountArg" and you're setting them
    //   to the variables "name" and "amount" respectively
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    // logic here to determine the name of the process to create an instance in
    idOfProcess as String
    idOfProcess = <hard coded string that has the id (not the name of the process to instantiate>
    ProcessInstance.create(processId : "/" + idOfProcess, arguments : argsIn, argumentsSetName : "BeginIn") ProcessInstance is in the Catalog inside Fuego.Lib.
    The processId parameter (the "idOfProcess" variable in the above logic) is the thing I most commonly screw up with this. It is the text you see when you right mouse click the process in the Project Navigator tab -> "Properties". Look at the value in the "Id" field and not the "Name" field here (the name without any space characters). Prefix it with a "/" as is shown here and if you've deployed this using an organization unit (OU) then prefix this to the string also.
    The third parameter is almost always "BeginIn". Begin activities in a process can have many incoming argument mappings, the default is "BeginIn". To see yours, double click the process's Begin activity and look at the mapping's name in the upper left corner of the dialog.
    "argsIn" is the set of incoming argument variables you want passed into the process. A common mistake is to type in the names of the incoming argument variables without the double quotes like this:
    // this will *NOT* work
    argsIn[someArgVarName] = "Hello"
    argsIn[someBpmObject] = myBpmObject
    . . .Here is the correct syntax:
    // this *WILL* work
    argsIn["someArgVarName"] = "Hello"
    argsIn["someBpmObject"] = myBpmObject
    . . .In this example, the process has two argument variables. It does not matter if the incoming argument variables are primitive type arguments (e.g. String, Integer, Decimal...) or BPM Objects, it is always done the same way. In this example, there is a String incoming argument called "someArgVarName" and a BPM Object incoming argument called "someBpmObject".
    Dan

  • Start process from JSP which continues running after response is completed

    Is it possible to start a process from within JSP which can continue running after the HTTP response is complete, so the response doesn't time out??

    Your question is a little vague. If I am understanding your question correctly, it sounds like you are starting a process in JSP that takes a long time, and the browser is timing out. If this is your question, then here is my response:
    We've had this situation before. Often times it occurs because the JSP page launches a long database operation that could take an hour. You have a few choices, but one good approach is this (any variation of this works too):
    1. When the page loads and you need the process to start, create a new thread and have the long operation run from this thread. You can put the thread object into a session variable and store it for later use.
    2. Have the JSP code output a META-REFRESH tag on the page so that the page refreshes every 30 seconds or so.
    3. On each refresh, you get the thread object from the session context and check it to see if it is done or still running. If it is, then just output another META-REFRESH and the page will keep refreshing itself. If it is done, you can, of course, output a "finished" message to the user.
    You can also have a stop button on the page that you can use to send a message to the thread to stop.
    Hope that gives you some ideas!
    Michael

Maybe you are looking for