06-25-2008
everybody thankyou for your help. There is nothing wrong with the nested if statements just wondered if there was a more neat way.
Following on from chachabronsons question i do not understand the above, although i am intrigued as to how it would work.
The above example does not make sense for the following:
FILEA = TestFile1.txt (how would this be declared so the file could be in any case upper, lower or mixture)
FILEB = TestFile2.txt (how would this be declared so the file could be in any case upper, lower or mixture)
if [ ! -f $FILEA ]
then
if [ ! -f $FILEB ]
then
echo "Neither file exists"
exit
else
echo "File A does not exist but file B does"
exit
fi
else
if [ ! -f $FILEB ]
then
echo "File A exists but file B does not"
exit
fi
fi
Therefore if both files present run process
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
So, I've got a ton of files that I want to go through (ie something like 300,000), and they're all labeled sequentially. However I'm not 100% positive that they are all there.
Is there any way of running through a sequence of numbers, checking if the file is in the folder, if not appending it... (2 Replies)
Discussion started by: Julolidine
2 Replies
2. Shell Programming and Scripting
Hello
I am new to Perl, in fact I am on chapter one of the book. :) However I am in need of a Perl Script faster than I can finish the book. Perhaps someone can help me with my immediate need while I read my book.
I have a directory with hundreds of files that are all named like... (4 Replies)
Discussion started by: newftronics
4 Replies
3. Shell Programming and Scripting
I have a need to compare 2 files, then print results to file. Need to find items from file2 that are not found in file 1. thanks in advance!
example:
file 1:
abcde=12
fffff=6
bbbb=35
file2:
abcde=12
fffff=6
bbbb=35
ccccc=10
kkkkk=45 (8 Replies)
Discussion started by: discostu
8 Replies
4. Shell Programming and Scripting
I have a list containing strings. All strings should have either "smp" or "drw" else it is considered an error. I have written this code below. Any better ideas to tackle this?
set fdrw = 0
set fsmp = 0
foreach f ($Lst)
set fdrwtag = `echo $f | awk '/drw/'`
set fsmptag = `echo $f | awk... (1 Reply)
Discussion started by: kristinu
1 Replies
5. AIX
I'm in the process of migrating a system to some newer hardware (Power 5 to Power 7). I've done these migrations in the past, and have not had any problems. But this system does not see the new network controllers on the Power 7 system. The system was running AIX 5.3 before, I've upgraded it to... (5 Replies)
Discussion started by: acascianelli
5 Replies
6. SuSE
Hello,
This is a programming question as well as a suse question, so let me know if you think I should post this in programming.
I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies
7. Red Hat
I am trying to install VirtualBox on RHEL 5 but I need the 32 bit version for 32 bit Windows. When I run yum I get the following:
sudo yum localinstall /auto/spvtg-it/spvss-migration/Software/VirtualBox-4.3-4.3.2_90405_el6-1.i686.rpm
Loaded plugins: fastestmirror
Setting up Local Package... (13 Replies)
Discussion started by: gw1500se
13 Replies
8. Shell Programming and Scripting
I have a fixed width file. The records looks something similar to below:
Type ID SSN NAME .....AND SOME MORE FIELDS
A1 1234 .....
A1 1234 .....
B1 1234 .....
M2 4567 .....
M2 4567 .....
N2 4567 .....
N2 4567 .....
A1 9999
N2 9999
Now if A1 is present then B1 has to be present.... (2 Replies)
Discussion started by: Saanvi1
2 Replies
9. Shell Programming and Scripting
The contents of my service file srvtemplate-data-i4-s1.conf is
Description=test service for users
After=network.target local-fs.target
Type=forking
RemainAfterExit=no
PIDFile=/data/i4/srvt.pid
LimitCORE=infinity
EnvironmentFile=%I
.
.
.
WantedBy=multi-user.target (0 Replies)
Discussion started by: rupeshkp728
0 Replies
ZSYRK(3) BLAS routine ZSYRK(3)
NAME
ZSYRK - perform one of the symmetric rank k operations C := alpha*A*A' + beta*C,
SYNOPSIS
SUBROUTINE ZSYRK ( UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC )
CHARACTER*1 UPLO, TRANS
INTEGER N, K, LDA, LDC
COMPLEX*16 ALPHA, BETA
COMPLEX*16 A( LDA, * ), C( LDC, * )
PURPOSE
ZSYRK performs one of the symmetric rank k operations
or
C := alpha*A'*A + beta*C,
where alpha and beta are scalars, C is an n by n symmetric matrix and A is an n by k matrix in the first case and a k by n matrix
in the second case.
PARAMETERS
UPLO - CHARACTER*1.
On entry, UPLO specifies whether the upper or lower triangular part of the array C is to be referenced as follows:
UPLO = 'U' or 'u' Only the upper triangular part of C is to be referenced.
UPLO = 'L' or 'l' Only the lower triangular part of C is to be referenced.
Unchanged on exit.
TRANS - CHARACTER*1.
On entry, TRANS specifies the operation to be performed as follows:
TRANS = 'N' or 'n' C := alpha*A*A' + beta*C.
TRANS = 'T' or 't' C := alpha*A'*A + beta*C.
Unchanged on exit.
N - INTEGER.
On entry, N specifies the order of the matrix C. N must be at least zero. Unchanged on exit.
K - INTEGER.
On entry with TRANS = 'N' or 'n', K specifies the number of columns of the matrix A, and on entry with TRANS =
'T' or 't', K specifies the number of rows of the matrix A. K must be at least zero. Unchanged on exit.
ALPHA - COMPLEX*16 .
On entry, ALPHA specifies the scalar alpha. Unchanged on exit.
A - COMPLEX*16 array of DIMENSION ( LDA, ka ), where ka is
k when TRANS = 'N' or 'n', and is n otherwise. Before entry with TRANS = 'N' or 'n', the leading n by k part of the array
A must contain the matrix A, otherwise the leading k by n part of the array A must contain the matrix A. Unchanged on exit.
LDA - INTEGER.
On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANS = 'N' or 'n' then LDA
must be at least max( 1, n ), otherwise LDA must be at least max( 1, k ). Unchanged on exit.
BETA - COMPLEX*16 .
On entry, BETA specifies the scalar beta. Unchanged on exit.
C - COMPLEX*16 array of DIMENSION ( LDC, n ).
Before entry with UPLO = 'U' or 'u', the leading n by n upper triangular part of the array C must contain the upper triangular
part of the symmetric matrix and the strictly lower triangular part of C is not referenced. On exit, the upper triangular part
of the array C is overwritten by the upper triangular part of the updated matrix. Before entry with UPLO = 'L' or 'l', the
leading n by n lower triangular part of the array C must contain the lower triangular part of the symmetric matrix and the
strictly upper triangular part of C is not referenced. On exit, the lower triangular part of the array C is overwritten by the
lower triangular part of the updated matrix.
LDC - INTEGER.
On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, n
). Unchanged on exit.
Level 3 Blas routine.
-- Written on 8-February-1989. Jack Dongarra, Argonne National Laboratory. Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical
Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd.
BLAS routine 16 October 1992 ZSYRK(3)