Sponsored Content
Top Forums Shell Programming and Scripting Unix shell script couldn't be executed. Pls help! Post 302088819 by BOFH on Thursday 14th of September 2006 02:45:51 PM
Old 09-14-2006
As far as the script, you might consider indenting the info in loops and if statements to make the more readable.

Most scripts I've seen don't do:

Code:
then DBDOWN=1

and

Code:
else DBDOWN=0

Usually it's something like:

Code:
if [ $? -eq 1 ]
then
  DBDOWN=0
else
  DBDOWN=1
fi

That way it's easier to see what code belongs with which part of a statement.

Yea, that while loop. I didn't realize it was a large as it was until I looked a little harder. It initially looked like an infinite loop.

And you're going to need to echo something to the mail statements. At least on the one I just tested it on, mail is looking for a body to pass along. So something like:

Code:
echo "SQL Failure" | mail -s "subjectline text" test@company.com

Also, $? is a numeric value so use "-eq" vs "=". It'll probably work but it's always good to use the correct syntax.

Carl
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script doesn't get executed using crontab

I have the following crontab entry to run a shell script for every 30 minutes of every day: 30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log after I created the crontab file I have also done: $crontab my_crontab I also check to make sure it exists, by using the following... (11 Replies)
Discussion started by: radhika
11 Replies

2. AIX

Help - Need simple example of VI executed in shell script

Please help - I have seen others ask this question but I need a simple example of using vi in a shell script. Once I enter VI the shell script does not execute the next commands until I q!. I invoke VI and start the edit process. I want to go to the third line and replace a character with a new... (2 Replies)
Discussion started by: corsart
2 Replies

3. Shell Programming and Scripting

korn shell script executed with error

Hi, need help, I would like to know what is this IF statement trying to do? When the script is executing and error out with line 9 which is the IF statement line. if ] then TOPDIR=$(pwd) else TOPDIR=${0%/*} fi TOPDIR=${TOPDIR%/*} the log file. Current system time is... (15 Replies)
Discussion started by: beooi
15 Replies

4. Shell Programming and Scripting

help with shell script executed by php.

I made a shell script to execute a server in screen mode. # start server screen -d -m -S Test ./application echo "Program Started Successfully" than I'm executing it from php by echo shell_exec('/home/script.sh'); and it is giving me this error. "cannot make directory... (1 Reply)
Discussion started by: dmallia
1 Replies

5. Shell Programming and Scripting

Shell script executed from Informatica ETL tool is spawning 2 processes for one script

Hi, I am having a shell script which has a while loop as shown below. while do sleep 60 done I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Discussion started by: chekusi
2 Replies

6. Shell Programming and Scripting

Shell script not getting executed

Hi As per my requirement when I run . ./file.sh am getting the following error -bash:ELF: command not found when i execute as ./file.sh it is getting executed.How to resolve this. Thanks in advance. (3 Replies)
Discussion started by: pracheth
3 Replies

7. UNIX for Dummies Questions & Answers

How to send keyboard inputs toa UNIX command executed from a shell script?

I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies

8. Shell Programming and Scripting

Multiple shell scripts executed in one script

Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it... (1 Reply)
Discussion started by: Madhu Siddula
1 Replies

9. Shell Programming and Scripting

Multiple shell scripts executed in one script

Hi every one, i am new to shell script. my people given a task to write a shell script that should execute number of shell scripts in that. in that, if any shell script is failed to execute, we have to run the main script again, but the script should start execute from the failed script only.. it... (6 Replies)
Discussion started by: Madhu Siddula
6 Replies

10. Shell Programming and Scripting

Capture run time of python script executed inside shell script

I have bash shell script which is internally calling python script.I would like to know how long python is taking to execute.I am not allowed to do changes in python script.Please note i need to know execution time of python script which is getting executed inside shell .I need to store execution... (2 Replies)
Discussion started by: Adfire
2 Replies
Imager::Expr::Assem(3pm)				User Contributed Perl Documentation				  Imager::Expr::Assem(3pm)

NAME
Imager::Expr::Assem - an assembler for producing code for the Imager register machine SYNOPSIS
use Imager::Expr::Assem; my $expr = Imager::Expr->new(assem=>'...', ...) DESCRIPTION
This module is a simple Imager::Expr compiler that compiles a low-level language that has a nearly 1-to-1 relationship to the internal representation used for compiled register machine code. Syntax Each line can contain multiple statements separated by semi-colons. Anything after '#' in a line is ignored. Types of statements: variable definition "var" name:type defines variable name to have type, which can be any of "n" or "num" for a numeric type or "pixel", "p" or "c" for a pixel or color type. Variable names cannot include white-space. operators Operators can be split into 3 basic types, those that have a result value, those that don't and the null operator, eg. jump has no value. The format for operators that return a value is typically: result = operator operand ... and for those that don't return a value: operator operand where operator is any valid register machine operator, result is any variable defined with "var", and operands are variables, constants or literals, or for jump operators, labels. The set operator can be simplified to: result = operator All operators maybe preceded by a label, which is any non-white-space text immediately followed by a colon (':'). BUGS
Note that the current optimizer may produce incorrect optimization for your code, fortunately the optimizer will disable itself if you include any jump operator in your code. A single jump to anywhere after your final "ret" operator can be used to disable the optimizer without slowing down your code. There's currently no high-level code generation that can generate code with loops or real conditions. SEE ALSO
Imager(3), transform.perl, regmach.c AUTHOR
Tony Cook <tony@develop-help.com> perl v5.14.2 2011-06-06 Imager::Expr::Assem(3pm)
All times are GMT -4. The time now is 01:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy