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 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 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?
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 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.
I created executables of a python script (via pyinstaller) for Mac, Windows and Linux. For Linux and Mac, I am running them in the shell since it doesn't have an own interface: just open a shell and type the name of the program.
I am wondering if there is a way to use certain file ending so if the user clicks on the program, it will be automatically executed in the shell or terminal.
I am logging in linux with my userName and using the pbrun su appName for changing permissions of files (owner of the files is appName). Now I am trying to do same within shell script but failing . Here is my code .
#Function to change permission of a file
pbrun su appName
chmod $pMode $fileName