I'm writing a shell script for I can launch a program from the terminal using ./AppName but how can i get the return value either 0 or 1 to determine if the program executed correctly
on 03/05/2010 – Made popular on 03/05/2010
I am trying to write a shell script and at a point the script launches a c program and how do I make the script to wait till that program is executed before executing the subsequent steps. As of now my script is not waiting until the program is completely executed and this is causing only a part of it being executed before the script completes execution
I wrote a shell script in linux to check if one of my program (say programA) is running, if it stopped, it will restart the program.
ok, I also have a php script which hav start & stop button to start and stop the same program from the server side. If the program is already run by the shell script, clicking on start button will NOT run multiple of the same program.
I am really new to shell scripting and I am trying to fetch the memory and cpu utilization of the processes. In the future I am going to run this script from java program so that I can get the utilization of all the child process of that java program.
I want to run a shell script from a java program. My shell script(loop_shell.sh) is working fine when I am running it in terminal and even my Java program(Execute.java) is working fine while running with other commands like 'ls' etc. But when I try run shell script from the Java program, shell script is not printing the values which are inside a loop.
Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key is pressed.
I have several programs that i'm executing in a shell script:
I know that I can profile each individual program by editing the sourcecode, but I wanted to know if there was a way I could measure the total time executed by profiling the script itself. Is there a timer program that I can use for this purpose? If so, how precise is its measurement?
I am trying to implement a simple shell script program that does not make use of
find commands as they are quite expensive on very large sets of files. So, I am trying to generate the file list myself. What I am trying to do is this:
1. Generate a file name using shell script, for example, 1.dat, 2.dat,..., so on.