12-17-2007
After executing a command, the result code can be obtained by using the variable $?
for example
command1
RES=$?
if [ $RES -ne 0 ]
then
echo "Error launch command"
else
echo "Command was succesful"
fi
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a matrix , how do I compare all the elements of a column , lets say I want to check if the columns contain the alphabets "S","H","A","R","A","T".
and not "X"s.
Lets say matrix looks something like this ..
SSSXSH
HHXXHA
AAXXAT
RRRXRS
AAXTAR
TTTTTA
I can hard code it where... (4 Replies)
Discussion started by: sharatz83
4 Replies
2. Shell Programming and Scripting
Yet another question. I want to make something like this:
if ||&&
then
...
fi
but that apparently is not right. I want either the first condition to be true OR the second AND third conditions to be true for the "then" to be processed. How can I do this? (1 Reply)
Discussion started by: jeriryan87
1 Replies
3. Shell Programming and Scripting
Pardon the pseudo code below, but I'm wondering how I would do something along the lines of this...
#!/bin/sh
excludeList="A B"
theItem="C"
if
then
echo $theItem
fi
I know I could loop through the array and check against each value, but was wondering if there was an alternate way... (1 Reply)
Discussion started by: myndcraft
1 Replies
4. Shell Programming and Scripting
Hi was wonderring about the syntax for the following peice of code:
while ] ; do
This is apparently incorrect. I want the loop to continue WHILE $life is not equal to zero or $mask is not equal to $word. Should ONE of these conditions fail to be met, loop should break out. Any ideas? ... (8 Replies)
Discussion started by: santeria
8 Replies
5. UNIX for Dummies Questions & Answers
Hi,
We have one UNIX Server (Sun Solaris), and the files coming to this server from another server.
The problem is, that server is continously sending files to our server via FTP. But the observation is that some files missing in our Server but in that server it shows the files FTPed... (2 Replies)
Discussion started by: vikash.rastogi
2 Replies
6. Shell Programming and Scripting
Hi there, I have a table that stores multiple records for many different servers, each of which is timestamped ... I wanted to write a query that would enable me to only output the "latest" record (based on timestamp) for each "unique" server. So for example my main table looks like this
... (3 Replies)
Discussion started by: hcclnoodles
3 Replies
7. Shell Programming and Scripting
Hello, pro scripters, noob here,
I am complete noob in this and I have to write a program which:
Calculates the modulus of two numbers which the user enters with keyboard. Number interval 1-9. These two numbers that were entered and modulus which was calculated are stored in a separate file.... (1 Reply)
Discussion started by: IrmantasID
1 Replies
LEARN ABOUT DEBIAN
sla_lin_berr
sla_lin_berr.f(3) LAPACK sla_lin_berr.f(3)
NAME
sla_lin_berr.f -
SYNOPSIS
Functions/Subroutines
subroutine sla_lin_berr (N, NZ, NRHS, RES, AYB, BERR)
SLA_LIN_BERR
Function/Subroutine Documentation
subroutine sla_lin_berr (integerN, integerNZ, integerNRHS, real, dimension( n, nrhs )RES, real, dimension( n, nrhs )AYB, real, dimension( nrhs
)BERR)
SLA_LIN_BERR
Purpose:
SLA_LIN_BERR computes componentwise relative backward error from
the formula
max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) )
where abs(Z) is the componentwise absolute value of the matrix
or vector Z.
Parameters:
N
N is INTEGER
The number of linear equations, i.e., the order of the
matrix A. N >= 0.
NZ
NZ is INTEGER
We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to
guard against spuriously zero residuals. Default value is N.
NRHS
NRHS is INTEGER
The number of right hand sides, i.e., the number of columns
of the matrices AYB, RES, and BERR. NRHS >= 0.
RES
RES is REAL array, dimension (N,NRHS)
The residual matrix, i.e., the matrix R in the relative backward
error formula above.
AYB
AYB is REAL array, dimension (N, NRHS)
The denominator in the relative backward error formula above, i.e.,
the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B
are from iterative refinement (see sla_gerfsx_extended.f).
BERR
BERR is REAL array, dimension (NRHS)
The componentwise relative backward error from the formula above.
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
November 2011
Definition at line 102 of file sla_lin_berr.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.1 Sun May 26 2013 sla_lin_berr.f(3)