Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 7/271 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Why does exec:java work and exec:exec fail?

    - by whiskerz
    Hey there, just set up a simple project to test the functionality of the maven exec plugin. I have one class containing one "Hello World" main method. I've tested two configurations of the exec plugin. <goals> <goal>exec</goal> </goals> <configuration> <executable>java</executable> <arguments> <argument>-classpath</argument> <classpath/> <argument>test.exec.HelloWorldExec</argument> </arguments> </configuration> failed miserably, giving me a ClassNotFoundException, while <goals><goal>java</goal></goals> <configuration> <mainClass>test.exec.HelloWorldExec</mainClass> </configuration> worked. However I would like to be able to start my java main class in a separate process, so I'd like to understand whats different with exec:exec and how I can get it to work? Any help appreciated cheers Whizz

    Read the article

  • How do the environments of a standard Terminal command-line and a bash script differ?

    - by fred.bear
    I know there is something different about the environment of the Terminal command-line and the environment in a bash script, but I don't know what that difference is... Here is the example which finally led me to ask this quesiton; it may flush out some of the differences. I am trying to strip leading '0's from a number, with this command. var="000123"; var="${var##+(0)}" ; echo $var When I run this command from the Terminal's command-line, I get: 123 However, when I run it from within a script, it doesn't work; I get: 000123 I'm using Ubuntu 10.04, and tried all the following with the sam results: GNOME Terminal 2.30.2 Konsole 2.4.5 #!/bin/bash #!/bin/sh What is causing this difference? Even if some upgrade will make it work in scripts... I am trying to find out the what and why, so in future, I'll know what to look out for .

    Read the article

  • md5deep error with after compression and extraction

    - by Sai
    I am using md5deep to generate the checksum for the contents of an entire directory. After generation, if I use the checksum file and run a check, there are no errors. However, if I compress the file and extract it, it seems to generate an error about a missing file. The file is just called .md5. There is no file called .md5 inside the directory. It seems to create a file that is not existent. This problem exists when I use md5sum or md5deep. Any thoughts on why this is happening?

    Read the article

  • How to handle inputs in a C shell program during exec

    - by hits_lucky
    I am currently writing my own shell program. This simple shell can just execute commands. When executing commands like vi or calc which require input from the terminal , the command is getting executed and is waiting for the input from the user. But I am unable to give any input on the screen. How should the input be handled during the fork and exec. Here is the piece of code which is executing commands: if((pid = fork()) < 0) { perror("Fork failed"); exit(errno); } if(pid == 0) { // Child process if(execvp(arguments[0], arguments) == -1) { child_status = errno; switch(child_status) { case ENOENT: printf(" command not found \n"); break; } exit(errno); } } else { // parent process int wait_stat; if(waitpid(pid , &wait_stat, WNOHANG) == -1) { printf(" waitpid failed \n"); return; } } } ~ Thanks,

    Read the article

  • Java Runtime.getRuntime().exec() alternatives

    - by twilbrand
    I have a collection of webapps that are running under tomcat. Tomcat is configured to have as much as 2 GB of memory using the -Xmx argument. Many of the webapps need to perform a task that ends up making use of the following code: Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(command); process.waitFor(); ... The issue we are having is related to the way that this "child-process" is getting created on Linux (Redhat 4.4 and Centos 5.4). It's my understanding that an amount of memory equal to the amount tomcat is using needs to be free in the pool of physical (non-swap) system memory initially for this child process to be created. When we don't have enough free physical memory, we are getting this: java.io.IOException: error=12, Cannot allocate memory at java.lang.UNIXProcess.<init>(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) ... 28 more My questions are: 1) Is it possible to remove the requirement for an amount of memory equal to the parent process being free in the physical memory? I'm looking for an answer that allows me to specify how much memory the child process gets or to allow java on linux to access swap memory. 2) What are the alternatives to Runtime.getRuntime().exec() if no solution to #1 exists? I could only think of two, neither of which is very desirable. JNI (very un-desirable) or rewriting the program we are calling in java and making it it's own process that the webapp communicates with somehow. There has to be others. 3) Is there another side to this problem that I'm not seeing that could potentially fix it? Lowering the amount of memory used by tomcat is not an option. Increasing the memory on the server is always an option, but seems like more a band-aid. Servers are running java 6.

    Read the article

  • java Processbuilder - exec a file which is not in path on OS X

    - by Jakob
    Okay i'm trying to make ChucK available in exported Processing sketches, i.e. if i export an app from Processing, the ChucK VM binary will be executed from inside the app. So as a user of said app you don't need to worry about ChucK being in your path at all. Right now i'm generating and executing a bash script file, but this way i don't get any console output from ChucK back into Processing: #!/bin/bash cd "[to where the Chuck executable is located]" ./chuck --kill killall chuck # just to make sure ./chuck chuckScript1.ck cuckScriptn.ck then Process p = Runtime.getRuntime().exec("chmod 777 "+scriptPath); p = Runtime.getRuntime().exec(scriptPath); This works but i want to run ChucK directly from Processing instead, but can't get it to execute: String chuckPath = "[folder in which the chuck executable is located]" ProcessBuilder builder = new ProcessBuilder (chuckPath+"/chuck", "test.ck"); final Process process = builder.start(); InputStream is = process.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); String line; while((line = br.readLine()) != null) println(line); println("done chuckin'! exitValue: " + process.exitValue()); Sorry if this is newbie style :D

    Read the article

  • exec() in BeanShell macro causes jEdit to hang when it returns non-zero exit code

    - by rossmeissl
    I have a jEdit BeanShell macro that runs my Markdown files through Maruku when I save them: if (buffer.getMode().toString().equals("markdown")) { cmd = "C:\\Ruby\\bin\\maruku.bat -o " + buffer.getDirectory() + buffer.getName().replaceAll("markdown$", "html") + " " + buffer.getPath(); exec(cmd); } This works great when the Markdown file is valid. But if I've made a mistake, jEdit just waits around forever for the exec() call to "succeed," which it never will. When this happens, I have to kill jEdit's javaw.exe process and run Maruku manually from the command line to discover the error, e.g.: E:\bp\plan\supply_chain>maruku business_plan.markdown ___________________________________________________________________________ | Maruku tells you: +--------------------------------------------------------------------------- | Could not find ref_id = "17" for md_link(["17"],"17") | Available refs are [] +--------------------------------------------------------------------------- !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/errors_management.rb:49:in `maruku_error' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:716:in `to_html_link' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in `send' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:970:in `array_to_html' !C:/Ruby/lib/ruby/gems/1.8/gems/maruku-0.6.0/lib/maruku/output/to_html.rb:961:in `each' \___________________________________________________________________________ Not creating a link for ref_id = "17". Then I restart jEdit, fix the error, and re-save the file, at which point the macro succeeds. How can I make my macro more resilient to either die helpfully (display Maruku's error output) or, at the very least, die silently so I don't have to kill jEdit?

    Read the article

  • how do i set c-shell environment variables in tcsh shell script

    - by rambokayambo
    i am trying to set the environment variables in tcsh shell and it is not working. This is the syntax that i am using currently setenv MYSQL_HOME=/opt/mysql/mysql/bin my other question is i have a c-shell script that i am editing. Is setenv the same as a regular set MYSQL=${MYSQL_HOME}/bin/sqlplus? set MYSQL_HOME=/opt/mysql/mysql/bin or should i just set the MYSQL_HOME to where the mysql executable is ?

    Read the article

  • in x64 Windows is there a way to run a Runtime.exec() process avoiding 'Registry redirection'

    - by raticulin
    Our app runs in jvm 32 bit, even when in windows x64. Now, at some point, I need to access some registry values, for example HKEY_LOCAL_MACHINE/SOFTWARE/mycomp. I do this by executing cmd /C reg query HKEY_LOCAL_MACHINE\SOFTWARE\mycop from Runtime.exec() and parsing the output. This works fine when running on windows 32b, the problem is when on x64, I cannot find the key, as the shell I run is a 32 bit process, and due to Registry Redirection I would get the key if it was on HKEY_LOCAL_MACHINE/SOFTWARE/wow6432Node/mycop Any idea?

    Read the article

  • Runtime.exec causes duplicate JVM to hang indefinitely until killed (Solaris 10)

    - by John
    All, We are running a J2EE application on WebLogic server 9.2 MP2 with a jrockit 64-bit JVM (27.3.1) on Solaris 10. We call use runtime.exec to call an executable called jfmerge to create PDF documents. We have found that in Solaris, when runtime.exec is called, a duplicate JVM is temporarily spawned to kick off the jfmerge process. While this is inefficient (our JVM is 5 GB, thus the duplicated shell JVM is also 5 GB), the major problem lies in the fact that when there is heavy load on this functionality (PDF generation) in our application, sometimes the duplicated JVM never exits. When the JVM hangs, the servers create large issues (extreme application slowness and terminated user sessions) as the entire duplicate JVM get's all of its 5 GB of process size written to disk swap. We have noted the following hung thread correlated with a hung JVM process until the process is manually killed: "[STUCK] ExecuteThread: '17' for queue: 'weblogic.kernel.Default (self-tuning)'" id=3463 idx=0x158 tid=3460 prio=1 alive, in native, daemon at jrockit/io/FileNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BII)I(Native Method) at jrockit/io/FileNativeIO.readBytes(FileNativeIO.java:30) at java/io/FileInputStream.readBytes([BII)I(FileInputStream.java) at java/io/FileInputStream.read(FileInputStream.java:194) at java/lang/UNIXProcess$DeferredCloseInputStream.read(UNIXProcess.java:227) at java/io/BufferedInputStream.fill(BufferedInputStream.java:218) at java/io/BufferedInputStream.read(BufferedInputStream.java:235) ^-- Holding lock: java/io/BufferedInputStream@0xfffffffec6510470[thin lock] at gov/v3/common/formgeneration/sessionbean/FormsBean.getProcessStatus(FormsBean.java:809) at gov/v3/common/formgeneration/sessionbean/FormsBean.createPDF(FormsBean.java:750) at gov/v3/common/formgeneration/sessionbean/FormsBean.getTemplateDetails(FormsBean.java:450) at gov/v3/common/formgeneration/sessionbean/FormsBean.generateSinglePDF(FormsBean.java:1371) at gov/v3/common/formgeneration/sessionbean/FormsBean.generatePDF(FormsBean.java:263) at gov/v3/common/formgeneration/sessionbean/FormsBean.endorseDocument(FormsBean.java:2377) at gov/v3/common/formgeneration/sessionbean/Forms_qaco28_EOImpl.endorseDocument(Forms_qaco28_EOImpl.java:214) at gov/v3/delegates/common/FormsAndNoticesDelegate.endorseDocument(FormsAndNoticesDelegate.java:128) at gov/v3/actions/common/EndorseDocumentAction.executeRequest(EndorseDocumentAction.java:68) at gov/v3/fwk/controller/struts/action/V3CommonDispatchAction.dispatchToExecuteMethod(V3CommonDispatchAction.java:532) at gov/v3/fwk/controller/struts/action/V3CommonDispatchAction.executeBaseAction(V3CommonDispatchAction.java:336) at gov/v3/fwk/controller/struts/action/V3BaseDispatchAction.execute(V3BaseDispatchAction.java:69) at org/apache/struts/action/RequestProcessor.processActionPerform(RequestProcessor.java:484) at gov/v3/fwk/controller/struts/requestprocessor/V3TilesRequestProcessor.processActionPerform(V3TilesRequestProcessor.java:384) at org/apache/struts/action/RequestProcessor.process(RequestProcessor.java:274) at org/apache/struts/action/ActionServlet.process(ActionServlet.java:1482) at org/apache/struts/action/ActionServlet.doGet(ActionServlet.java:507) at gov/v3/fwk/controller/struts/servlet/V3ControllerServlet.doGet(V3ControllerServlet.java:110) at javax/servlet/http/HttpServlet.service(HttpServlet.java:743) at javax/servlet/http/HttpServlet.service(HttpServlet.java:856) at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:283) at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231) at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:121) at weblogic/servlet/internal/WebAppServletContext.securedExecute(WebAppServletContext.java:2002) at weblogic/servlet/internal/WebAppServletContext.execute(WebAppServletContext.java:1908) at weblogic/servlet/internal/ServletRequestImpl.run(ServletRequestImpl.java:1362) at weblogic/work/ExecuteThread.execute(ExecuteThread.java:209) at weblogic/work/ExecuteThread.run(ExecuteThread.java:181) at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method) -- end of trace We would like to do a couple of things: 1.) Prevent the spawning of a duplicate JVM, as we do not need any of it's functions when executing the simple jfmerge executable, and it creates massive overhead. 2.) In the short term at least prevent this duplicate JVM from handing indefinitely.

    Read the article

  • How to escape spaces in .desktop files Exec line

    - by nh2
    I want to make a .desktop file like described here. [Desktop Entry] Name=Sublime Text 2 GenericName=Sublime Text 2 Comment=Edit text files Exec=/home/user/opt/sublime/Sublime Text 2/sublime_text %U However, running that from Nautilus's context menu using Open with this gives me Could not find '/home/user/opt/sublime/Sublime' So I tried Exec="/home/user/opt/sublime/Sublime Text 2/sublime_text" %U and got Text ended before matching quote was found for ". (The text was '"/home/user/opt/sublime/Sublime') What is the correct way to escape spaces in the Exec line of .desktop files?

    Read the article

  • Cannot install extensions required for GNOME Shell themes

    - by Soham Chowdhury
    I keep getting this output: soham@fortress:~$ sudo apt-get install gnome-shell-extensions gnome-tweak-tool Reading package lists... Done Building dependency tree Reading state information... Done gnome-tweak-tool is already the newest version. The following NEW packages will be installed: gnome-shell-extensions 0 upgraded, 1 newly installed, 0 to remove and 43 not upgraded. 1 not fully installed or removed. Need to get 0 B/121 kB of archives. After this operation, 849 kB of additional disk space will be used. Do you want to continue [Y/n]? y (Reading database ... 179291 files and directories currently installed.) Unpacking gnome-shell-extensions (from .../gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb) ... dpkg: error processing /var/cache/apt/archives/gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb (--unpack): trying to overwrite '/usr/share/locale/lv/LC_MESSAGES/gnome-shell-extensions.mo', which is also in package gnome-shell-extensions-common 3.2.0-0ubuntu1~oneiric1 No apport report written because MaxReports is reached already dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Errors were encountered while processing: /var/cache/apt/archives/gnome-shell-extensions_3.4.1~git20120508.dfd7191a-0ubuntu1~12.04~ricotz0_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Update: Fixed that. Now GNOME Tweak Tool shows me an exclamation mark beside the extension enable button, saying "Extension doesn't support shell version". My GNOME shell is already the latest version. Help!

    Read the article

  • Native PHP vs exec()

    - by resting
    Just wondering, assuming no security issues, that is, you're in total control of the command passed to exec(), is there a difference (in terms of speed or standards) between using exec() vs native PHP? Example just to name a few use cases: Using the DirectoryIterator vs exec(ls -1, $output), to list all files. List 100 files from the 99th file onwards (that is, file 100 to 199) Count total number of files in directory.

    Read the article

  • PHP exec() on windows not working

    - by Rich Harrington
    Hey, I'm trying to execute a program on windows through PHP, the command is posted below. This doesn't seem to be running through the script at all, even though it works when the command is manually entered into the command prompt. exec('C:\\ffmpeg -i ' . $movedfile . ' -acodec aac -ab 128k -vcodec libx264 -fpre C:\\ffmpeg\\share\\ffmpeg\\libx264-hq.ffpreset -crf 22 -threads 0 -wpredp 0' . $convertedfile); Any suggestions? Thanks! EDIT: There are two slashes for path seperators, stack overflow only displays one though

    Read the article

  • Why doesn't interface inheritance work when writing shell extensions in c#?

    - by Factor Mystic
    According to this article about writing shell extensions in .Net, inheriting the shell interfaces as you might naturally do when writing code doesn't work. I've observed this in my own code as well. Doesn't work: public interface IPersist { // stuff specific only to IPersist } public interface IPersistFolder : IPersist { // stuff specific only to IPersistFolder } Does work: public interface IPersistFolder { // stuff specific to IPersist only // stuff specific to IPersistFolder only } The article notes this fact: Lo and behold, it worked! Notice that I've abandoned any idea that IPersistFolder is inherited from anything at all and just included the stubs from IPersist right in its definition. In all candor, I can't tell you why this is but it definitely works just fine and shouldn't give you any problems. So my I'll ask the question this guy didn't know; why didn't the original code work?

    Read the article

  • SQL Exec T-SQL statement?

    - by salvationishere
    I am trying to list all of the columns from whichever Adventureworks table I choose. What T-sQL statement or stored proc can I execute to see this list of all columns? I want to use my C# web app to input one input parameter = table_name and then get a list of all the column_names as output. Right now I am trying to execute the sp_columns stored proc which works, but I can't get just the one column with select and exec combined. Does anybody know how to do this?

    Read the article

  • PHP exec() and system() functions always return false in IIS

    - by Loftx
    Hi there, I'm trying to use the PHP exec() or system() (or any other similar function) to run a batch file, but I can't seem to get these to return anything. The simplest example I've seen is this, which outputs nothing: <?php echo system('dir'); ?> The script is running on a windows XP machine on IIS with PHP installed and I've also tried it on my shared hosting account running windows 2003 server/IIS. Can anyone suggest what I need to do to get this working, or provide any commands I can use for troubleshooting? Cheers, Tom

    Read the article

  • PHP exec not working with gcc

    - by teehoo
    I just spent a few hours pulling my hair out over this. I'm trying to get gcc to compile a file from within PHP. $command = "/usr/bin/gcc /var/www/progpad/temp/tNu7rq.c -o /var/www/progpad/temp/tNu7rq.out"; exec($command, $output, $returnVal); echo $returnVal."<br />"; //returns 1 echo json_encode($output); //returns [] I'm running this on my own ubuntu server and both /var/www/progpad/ /var/www/progpad/temp/ have chmod 777 set. If I copy and paste the command string, and paste it into the terminal it works perfectly. Also if I replace the command string with something like $command = "echo test > test.txt"; Then this has no problem creating the text file. What could I possibly be doing wrong here???

    Read the article

  • PHP exec() hangs, Error 500

    - by MRX_II
    So, my plan is to make small thumbnails of URL's with PHP and IECapt. IECapt works well, a nice command line tool, gets the full sized image of specified URL in 1 to 4 seconds. But my problem is to execute it trough PHP. This is the code I've trying to get working: exec('IECapt.exe ' . escapeshellarg($URL) . ' ' . escapeshellarg($Filename)) $URL is of course the URL, and $filename is a simplified version of the URL. Sometimes I get the IECapt to snap the image(trough PHP), but it takes awfully long (30-60s), and in the end I always get a 500-error, with no error messages to tell me what's wrong. Both variables are fine, they work manually with commandline: IECapt http://google.com Google.png My server set-up is IIS7 and PHP5.2.9, if relevant. (Windows Vista, all on my personal computer, so full access.) Any ideas?

    Read the article

  • php exec and shell_exec not working

    - by chris
    I want to run an exe file on my server and return the output to the browser screen. The exe file takes a input file and then returns data on the screen. Why is this code not working? $output = shell_exec('myprogram < INP.DAT'); echo "<pre>" . var_export($output, TRUE) ."</pre>\\n"; It displays "NULL" on the browser screen. I have also tried exec(). There it returns "Array()".

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >