How to run script file ( unix script file like ksh or sh file) using Java

How to run script file ( unix script file like ksh or sh file) using Java Program?.
I am using the following code snippet to run the simple commands like top or ls ,etc....
Runtime runtime = Runtime.getRuntime();
Process proc = runtime.exec("top");
Thanks In Adavance
-Siva

String [] { "ksh" , "-c" , "script", "arg 1", "arg 2", "arg 3"}

Similar Messages

  • How to run non-customised report from command prompt to gen trace file?

    Hi
    how to run non-customised report from command prompt to gen trace file?
    EBS R12 RUP6.
    RHEL5
    rgrds

    Hi,
    See (Note: 285497.1 - Rwrun.sh Does Not Generate Trace Output Using TRACEOPTS in Command Line) and/or (Note: 737445.1 - R12 Concurrent Requests Run Forever; rwrun Errors REP-50125) for the command you need to use.
    Thanks,
    Hussein

  • How to run import from Unix Oracle 8.0.5 database with Windows Oracle client?

    How to run import from Unix Oracle 8.0.5 database via network with Windows Oracle client? Is it possible? When I try to do it Oracle client just hangs... If not which ones are compatible Aix or Solaris to Unix or it must be a Unix client to connect to Unix Oracle database. Thank's for any help.

    Hi,
    In our project we are using this type. Since in this project server in UNIX(DEC) and client is running on windows. We have created a listener which always listen requests from client and doing the according to the request.
    Step1. create a request table, where u are inserting ur request.
    step2. create PRO*C proram, which is listening request on the table. If there is any request, call the imp (executable). This is happening on server side.
    Benifit. U can make a request from cleint and ftp the file client sit.
    Are u interested in more details and code, pls send a mail to me
    ---- Boby Jose Thekkanath
    [email protected]
    Dharma Computers(p) Ltd. Bangalore.
    null

  • How to run forms6i on Unix Machine

    Hi all,
    I have just migrated a form4.5 to form6i. We have character mode application.
    Can anyone give me some idea how to run form6i on unix machine.
    Is it the same way we run form4.5(f45gen xyz.fmb $Path) or bit different
    Thanks
    regds
    Lasily Thomas

    We run some Forms6i character-mode forms on Linux (using "f60run") and just started having some problems after we upgraded our database from 8i to 9i, and especially after applying the latest patch to 9.2.0.4. We get lots of ORA-03113 errors now. We also have problems with at least some calls to server-side (user-written, not built-in) stored functions (not procedures). The Forms compiler crashes on these unless we re-write those function calls to call new wrapper procedures that we wrote (that in turn call the existing functions).

  • How can I exit my UNIX script when my PLSQL script in it calls an error?

    hello.
    I hope someone can help with my error handling and exiting-in-the-right-place problem.
    I have several PLSQL scripts that are called from a UNIX script to insert/update employee records in ORACLE Financials.
    At the end of the UNIX script, depending on whether an entry has been created in the errors table should depend on whether the UNIX script stops or not. Trouble is, its stopping too early everytime even though the the record has been inserted correctly. Please can someone either advise on what I'm doing wrong or suggest an alternative..
    This the end of the PLSQL script that inserts the entry into errors table if theres an error..
    WHEN OTHERS    THEN       ROLLBACK;
          err_msg := SUBSTR (SQLERRM, 1, 350);
          insert into kpmg_error_check (concurrent_id,module,narrative,status,creation_date,created_by)
                                values(0,'TEMPLOYEE_DTLS.sql',err_msg,'ERROR',SYSDATE,'Feldman');
         commit; This is the end of the UNIX script that looks at the table..
    echo " "
    echo "**** `date +%H:%M:%S` - Checking if TEMPLOYEE_DTLS.sql ran OK"
    error_check=`sqlplus -s $user_id @$SU_TOP/sql/SUTEMPCHK.sql 1`
    if `echo $error_check` -ge 1
    then
    # Load failed
    echo " "
    echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has failed - check table KPMG_ERROR_CHECK for details.."
    exit 1
    else
    # Load finished OK, if input data file exists, move and rename it
    echo " "
    echo "**** `date +%H:%M:%S` - TEMPLOYEE_DTLS has finished OK.."
    fiThis is the entire SUTEMPCHK.sql script that the UNIX script uses..
    -- Check if any errors have occurred
    SELECT count(1) FROM kpmg_error_check WHERE concurrent_id = &1
    EXITIs it that the above is always returning '1' and so always thinks theres an entry in the errors table?
    Is there an easier way?
    many thanks,
    Steven

    Hi,
    You have to iterate through all pages.marginPreferences:
    var
      myDocument = app.activeDocument,
      allPagesMaPref = myDocument.pages.everyItem().marginPreferences,
      curPageMaPref;
    while ( curPageMaPref = allPagesMaPref.pop() )
      with (curPageMaPref) {
      columnCount = 1;
      //columnGutter can be a number or a measurement string.
      columnGutter = "0";
      bottom = "0"
      //When document.documentPreferences.facingPages == true,
      //"left" means inside; "right" means outside.
      left = "40"
      right = "0"
      top = "0"
      inside = "0"
    Jarek

  • I want to import my bookmarks from my old hard drive to my new computer. Old hard drive is in new computer as secondary drive, can't run firefox from it. Would like to find the file where my bookmarks are stored

    have looked in the old hard drive for the file where my favorites would be stored. the only file that I can find is not the latest. I did not back up my favorites on the old computer.

    Bookmarks are no longer stored in an html file. Instead, they are stored in a file called '''places.sqlite''' in your '''Profile''' folder.
    # Locate the '''places.sqlite''' file in your old hard drive.
    # Copy it into the '''Profile''' folder of your new hard drive.
    # Note that since you would be overwriting the places.sqlite in your new drive, your current bookmarks/history etc would be overwritten by the ones in the old drive.
    For more information, see these articles:
    [http://support.mozilla.com/en-US/kb/Recovering+important+data+from+an+old+profile Recovering important data from an old profile] and [http://kb.mozillazine.org/Places.sqlite places.sqlite]
    If you wish to know how to locate your Profile folder, read this article: [https://support.mozilla.com/en-US/kb/Profiles Profiles].

  • How to run applications with options in IDEs like Netbeans

    Hi, I'm new to the Netbeans IDE and I'm wondering how to run applications with options.
    Normally I'd enter the following in the command line:
    java -Djavax.net.ssl.keyStore=mykeystore -Djavax.net.ssl.keyStorePassword="..." TLSServer
    java  -Djavax.net.ssl.trustStore=mytruststore -Djavax.net.ssl.trustStorePassword="..." TLSClient localhostProblem is, I've no idea how to do the same thing in IDE's like Netbeans and I can't any settings to add options like "-Djavax.net.ssl.keyStore=mykeystore" before running the application. Any help will be appreciated.
    Message was edited by:
    Wolfgard

    Right-click the project, click properties, clicl run, and add parameters to VM Options.

  • How to run ps cs4 js script from applescript

    Hi, I need to call photoshop js from applescript. Here what I have so far:
    tell application "Adobe Photoshop CS4"
        activate
        set myScript to "Applications:Adobe Photoshop CS4:Presets:Scripts:_NDF_Ph_saveAsTif.jsx"
        do javascript (myScript)
    end tell
    and it's compiles, but when runs, gives me "Error 25: Expected: ;." message.
    How can I call ps script from as.
    Thank you very much for your help.
    Yulia

    You have 2 ways either JavaScript supplied as string or as file. If you are going the route of file then you need to coerce your path string to 'alias' this will fail if it does NOT exist. Here are 2 examples. You also have option to pass arguments as list.
    -- As String
    set JavaScript to "myTest();
    function myTest() {
    var docRef = app.activeDocument;
    var docWidth = docRef.width;
    var docHeight = docRef.height;
    var docSize = docWidth + ' x ' + docHeight
    return docSize
    tell application "Adobe Photoshop CS2"
    activate
    set Doc_Ref to the current document
    tell Doc_Ref
    do javascript JavaScript ¬
    show debugger on runtime error
    display dialog the result
    end tell
    end tell
    -- As File
    set ScriptPath to (path to applications folder as text) & "Adobe Photoshop CS2:Presets:Scripts:Hello.jsx" as alias
    tell application "Adobe Photoshop CS2"
    activate
    set Doc_Ref to the current document
    tell Doc_Ref
    do javascript ScriptPath ¬
    show debugger on runtime error
    end tell
    end tell

  • How to run virtualbox init.d script, if using systemd

    I just installed virtualbox and the host modules with pacman. I then created my virtual machine and switched to bridged network setting and get the following error.  I don't get this error when I use NAT.
    Failed to open a session for the virtual machine Learning Puppet VM (pe-3.0.1).
    Failed to open/create the internal network 'HostInterfaceNetworking-wlp2s0' (VERR_SUPDRV_COMPONENT_NOT_FOUND).
    One of the kernel modules was not successfully loaded. Make sure that no kernel modules from an older version of VirtualBox exist.
    Then try to recompile and reload the kernel modules by executing '/etc/init.d/vboxdrv setup' as root (VERR_SUPDRV_COMPONENT_NOT_FOUND).
    That init.d script doesn't exist, and as far as I can tell it wouldn't work with systemd anyway.
    Not sure what to do.
    Last edited by n_t (2013-10-07 15:47:56)

    https://wiki.archlinux.org/index.php/Vi … el_Modules
    https://wiki.archlinux.org/index.php/Vi … _interface
    Last edited by Scimmia (2013-10-07 19:42:39)

  • How do you download images from a web server to your hard drive using java?

    Can anyone help me with this? The only methods that i have found that are remotely useful are getContent() andgetContentType().
    But all the code I've fouund and studied doesnt say anyone about downloading images. What do I need to be looking for to acheive this?

    You have a URLConnection to the img URL right?
    Open that connection's input stream (URLConnection.getInputStream or something like that, look it up in the Javadoc API: http://java.sun.com/j2se/1.4.2/docs/api/)
    Once you have that stream, you can read its bytes to your heart's content, and write them to a file as you wish.

  • How to check whether Weblogic is hung /up with a Unix script

    Hi
    I would like to write a script for monitoring the weblogic server. I want to have a script that checks the weblogic once in a while if it's up and running. if not running, will send an email to me
    Please tell me what is that file name in weblogic that tells me this thing .
    Thanks for reading.

    This can't be answered without knowledge of your environment and how you run your WLS (version ?).
    The simplest way is to use a pgrep unix command and check for the right process (i.e. the name of the wls server).
    You have to keep in mind, that there might be several processes (i.e. one for the node manager one for each server).
    Timo

  • Running an Unix Script from Informatica Mapping/workflow.

    Hi ,
    I have a need to start /stop service to a remote server (away from the DAC server ,which is on UNIX os)
    how could this be done in a best way?
    I am planning to do this through Informatica Workflow,and need help (technical steps Please) to do this.
    1) workflow will call the Unix Script
    2) Unix Script logins to the remote server
    3) Unix scripts navigates to particular folder
    4) Unix script executes a command to Start/Stop the server.
    5) Unix Script logs out.
    6) if everything done success ,Workflow will success else fail with the error code.
    Regards

    Hi ,
    I have a need to start /stop service to a remote server (away from the DAC server ,which is on UNIX os)
    how could this be done in a best way?
    I am planning to do this through Informatica Workflow,and need help (technical steps Please) to do this.
    1) workflow will call the Unix Script
    2) Unix Script logins to the remote server
    3) Unix scripts navigates to particular folder
    4) Unix script executes a command to Start/Stop the server.
    5) Unix Script logs out.
    6) if everything done success ,Workflow will success else fail with the error code.
    Regards

  • How to run my jar file on a webserver

    hello everybody,
    I've created a chat aplication which consists of a client-side and server-side. The client-side is an applet and is working fine. But i'm getting problem with the server-side. Actually, it is working fine on my local system and even in a local area network. But now, i want to put the server-side on a webserver. So, i want to know how can i do that. My server-side is a jar file "chatserver.jar" which i've developed using frame containers. I want to know also how to run the chatserver.jar on the webserver. Is it that i should have implemented jsp? Or javascript? coz my chatserver must be always running 24/7. It must not be available to user. users will chat through applets and the data will be sent to the server-side which will in turn control and recognise those data. Can anyone please help me in that issue.

    that was very kind of u for replying to me. thanks a lot. Well, the web software i'm running is nothing soo great but it's simply a chat server side application. In this application, i'm using a thread where my datagram socket will keep on receiving data from clients and this server side apllication must response to the client. For example, if a client has added a new room, or a new user has logged in, the server side must take care to inform all other clients that a new user has just logged in or a new room has been created. The main method is in the "chatserver.class". Then, i've combined all my classes including the chatserver.class into a jar file. When i click on the jar file on my local system or on the server of a local area network, it works beautifully. So, my server side application works like that. I have to click on the chatserver.jar once and nothing else. No other interaction with the applicaion. But my problem is how to run it on a web-server like apache. Or even if i upload this software on a website, how do i make it run? Shall i implement jsp codes? If yes, how to execute such jar file using jsp?
    here are part of the codes where my datagramsocket is receiving message from clients:
    public void run()
         while(thread!=null)
              byte[] recbuf=new byte[65536];
              recpacket=new DatagramPacket(recbuf,recbuf.length);
              try{
                   servsocket.receive(recpacket);
                   if(servsocket==null)
         byte[] bt=recpacket.getData();
         String recvmess = new String(bt, 0, recpacket.getLength());
         InetAddress clientaddress=recpacket.getAddress();
         int clientport=recpacket.getPort();
         chatcom=new chatcom(this,clientaddress,clientport,recvmess);
         try{
              thread.sleep(10);     
         catch(InterruptedException _INExc)      
    chatcom is another class which i've created to differentiate if the data received is a message, new room, new user, etc... I've created my own RFC to make those differences. Like i said above, if a client has created a new room, the chatcom class will recognise that a new room has to be created and will therefore send the new room created to all other clients. So, i want to know how to get my "chatserver.jar" run on a web server like apache or even on a website if i want to upload this software. Coz once it starts running, i dnt hav to close the application. I mean to say that this application will have to run 24/7. Do i have to execute it externally using jsp codes? Is there any way to get my application run on a webserver?

  • How do run unix command in java

    hi
    All unix command working fine in our java program.
    but i want change user in linux by using java. it's not working.
    "su root" This command onely not working.
    anybody know help me
    This is my ID [email protected]
    This my code
    <% String s = null;
    try{
    Process p = Runtime.getRuntime().exec("su root");
    BufferedReader stdInput = new BufferedReader(new
    InputStreamReader(p.getInputStream()));
    BufferedReader stdError = new BufferedReader(new
    InputStreamReader(p.getErrorStream()));
    out.println("Here is the standard output of the command:\n");
    while ((s = stdInput.readLine()) != null)
    out.println(s);
    catch(Exception e) {}
    %>

    I don't have further info to add to your first post, but think your guess seems quite reasonable. I thought of starting a new thread on the same topic, but think this (question) fits in here, too.
    I have Java code (freeware, not opensoure), intended for Unix, which basically provides the graphical interface and relies on an I/O layer (C + shell scripts) to do most of the work. I have access to the C+shell scripts which are opensource. I ported it to Cygwin and want to use it under Windows (there is no Cygwin native Java VM).
    My problem now boils down to " how to run commands under Unix and what differences are there with Windows". What are the variants?
    I have to guess what the program is doing when I get an IOException at some point. E.g.: a call to shell script may be made in a different way as to a compiled exe in Unix?. I found a way to bypass path problems because forward slashes are also accepted and /cygdrive/c construct can be replace by c:/; shell scripts can be compiled into exes using shc and they work; if symbolic links are replaced by duplication of exe files, they work. What will happen in an instance whereby a process runs a shell script dynamically, through a pipe (the shell script is compiled in the Cygwin/win version and receives parameters) in a construct like:
    pipefp = epopen(cmdbuf,"w"); /* (cmbuf is "makehdr par1 par2 ... ") (makehdr was a shell script and is now compiled exe for Cygwin/Windows) */?.
    Thanks.
    LT

  • Unix script in PL/SQL

    I am building a txt file using UTL_FILE in PL/SQL and need to email it using a Unix script. How can I add the Unix script to the end of the PL/SQL?

    Well, on the UNIX side of things I have simply used mail -s <subject> <email_address> < <text or file> to send mail inside of a UNIX script and it works fine.
    or you can use cat <some text> | mail -s <subject> <email_address>
    UTL_SMTP works well if you want to have less moving parts and have one script compiled inside the database. I guess if you already have the UTL_FILE working, it would be less work to just add in the code to mail from the UNIX script.
    HTH
    ReedK

Maybe you are looking for

  • ITunes 11.0.44

    Although, there are dozens of posts about iTunes 11.0.44 causing problems with album art, I can't seem to find one with my specific problem. Prior to iTunes 11, I had no problem tagging my album art to my music. With the release of iTunes 11, my albu

  • Iphone heaven, ringtone ****!

    How can the UK users of the world get more ringtones than the standard? We can't create a ringtone in Itunes UK and I don't seem to have this Garage Band business even though my software is the latest!? Help!

  • Implementing the Scheduler on Solaris

    We are implementing the OBIEE scheduler on Solaris 9. We followed the steps in the bookshelf and run the run-sch.sh file. The scheduler log is created as a zero byte file and the process does not come up. Has anyone implemented the scheduler on Solar

  • How read the PDF and XML files after Unzipping the folder

    Hi Gurus, I have a zipped folder and i this two types of files .XML and .PDF files. I am able to unzip the folder and reading the .XML files, unable to read the PDF files. I want to send this PDF file to the target as it is. Please help me. Regards S

  • Advice to be sent to customer during BOE posting

    Hi, When we are posting for a BOE transaction through f110, a customer should be notified with an advice, showing the maturity date on which he has to pay the amount. Please provide some pointers, as to how to achive the same. Regards Rudra