Checking status of engines using C-shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Checking status of engines using C-shell
# 1  
Old 04-20-2012
Checking status of engines using C-shell

I am relatively new to scripting. I am trying to develop a script that will
1. Source an executable file as an argument to the script that sets up the environment
2. Run a command "stat" that gives the status of 5 Engines running on the system
3. Check the status of the 5 Engines as either "Active" or "Not Found"
4. Compare the status of all 5 Engines
if all "Active" exit 0
if some "Active" & some "Not Found" exit 1
if all "Not found" exit 2

I have to write this script in C-Shell. Currently I have written the script for Step 1 & 2. For the rest of it I am thinking of storing the status of the 5 Engines in an array and then compare the value of array elements to decide on the exit status. What do experts say? I am also having a little difficulty using Arrays in C-shell. C-shell is not as straight forward as sh or ksh.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

FIFO Status Checking/Running

May i please know 1) How to check if FIFO process is down? 2) How to bring FIFO up and running? we are using redhat Linux OS and bash shell Thank you. (1 Reply)
Discussion started by: Ariean
1 Replies

2. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

3. Shell Programming and Scripting

Script for SFTP Status Checking

Greetings... I have to construct shell script to check the SFTP status, Define a global variable (say sftpStatus). Set it to default value "success" when you define it first time outside the script. check the current SFTP status (say currentStatus - local variable within the script) if... (16 Replies)
Discussion started by: manju98458
16 Replies

4. Shell Programming and Scripting

Checking directory status

Can I use -ctime/-mtime to verify if a particular directory has been updated or not? I don't care about number of days. I just want to perform some operations only if the folder is modified (or it's metadata is modified), i.e. some files are added to the directory. This thread has a more... (1 Reply)
Discussion started by: Pramit
1 Replies

5. Shell Programming and Scripting

checking the status of sendmail

Hi All, I like to check the status of sendmail and take the appropriate action based on success / failure etc. I have gone through one of the thread where a suggestion is made to use RC for return code Following is the code: ================================== #!/usr/bin/bash export... (0 Replies)
Discussion started by: tmanda
0 Replies

6. Shell Programming and Scripting

Checking the status of mail sent.

Hi, Is there any way to check the status of the mail sent or not.e.g mail -s "Error Message" abc@xyz.com <aaa/bbb/data.txt Can it return a status code which will confirm the delivery of mail sent?Please suggest. Thanks, Anil (1 Reply)
Discussion started by: anil029
1 Replies

7. Shell Programming and Scripting

Checking Status of PID

I'm developing a script that spawns many background processes that will be executing concurrently and need to check the exit status of each spawned process after it terminates. After starting the background process I can get the pid from $! which I can store in an associative array but how do I... (2 Replies)
Discussion started by: twk
2 Replies

8. UNIX for Dummies Questions & Answers

checking the status of file ftp

Hi, I m new to unix and I need a help in FTp-ing a file. My script is given below ftp -n <<END_SCRIPT open $FTP_HOST user $FTP_USER $FTP_PASSWD lcd $TEMPFOLDER cd $FTP_LOCATION put $1 bye END_SCRIPT exit_status=$? if ; then log "successfully FTPed the file" else... (5 Replies)
Discussion started by: MeeraNair
5 Replies

9. Shell Programming and Scripting

checking exit status of a shell script

Hi, I have tried with the following code; if ;then echo "Failure." else echo "Success." fi to test the exit status of the test.ksh shell script. But whatever is the exit status of the test.ksh shell script Failure. is always printed. Please help. regards, Dipankar. (2 Replies)
Discussion started by: kdipankar
2 Replies

10. Shell Programming and Scripting

Checking Exit Status

I hope one of you smart people out there can help me with what seems like a real simple questing but I can't quite figure out. In a script I am doing a cmp on two files. I am trying to check the exit status with an if statement but can't seem to figure out the syntax. If the exit status is 1 I... (4 Replies)
Discussion started by: PrimeRibAndADew
4 Replies
Login or Register to Ask a Question
NPM-RUN-SCRIPT(1)                                                                                                                NPM-RUN-SCRIPT(1)

NAME
npm-run-script - Run arbitrary package scripts SYNOPSIS
npm run-script <command> [--silent] [-- <args>...] alias: npm run DESCRIPTION
This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts. As of ` https://blog.npmjs.org/post/98131109725/npm-2-0-0, you can use custom arguments when executing scripts. The special option -- is used by getopt https://goo.gl/KxMmtG to delimit the end of the options. npm will pass all the arguments after the -- directly to your script: npm run test -- --grep="pattern" The arguments will only be passed to the script specified after npm run and not to any pre or post script. The env script is a special built-in command that can be used to list environment variables that will be available to the script at run- time. If an "env" command is defined in your package, it will take precedence over the built-in. In addition to the shell's pre-existing PATH, npm run adds node_modules/.bin to the PATH provided to scripts. Any binaries provided by locally-installed dependencies can be used without the node_modules/.bin prefix. For example, if there is a devDependency on tap in your package, you should write: "scripts": {"test": "tap test/*.js"} instead of "scripts": {"test": "node_modules/.bin/tap test/*.js"} to run your tests. The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the /bin/sh command, on Windows it is the cmd.exe. The actual shell referred to by /bin/sh also depends on the system. As of ` https://github.com/npm/npm/releases/tag/v5.1.0 you can customize the shell with the script-shell configuration. Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run. If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run. npm run sets the NODE environment variable to the node executable with which npm is executed. Also, if the --scripts-prepend-node-path is passed, the directory within which node resides is added to the PATH. If --scripts-prepend-node-path=auto is passed (which has been the default in npm v3), this is only performed when that node executable is not found in the PATH. If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten. You can use the --silent flag to prevent showing npm ERR! output on error. You can use the --if-present flag to avoid exiting with a non-zero exit code when the script is undefined. This lets you run potentially undefined scripts without breaking the execution chain. SEE ALSO
o npm help 7 scripts o npm help test o npm help start o npm help restart o npm help stop o npm help 7 config January 2019 NPM-RUN-SCRIPT(1)