03-01-2013
Here is a
link that explains the purpose & usage of
IFS
Using the operator
=~, the left hand side operand
$v1 is matched against the character class
^[[:alpha:]]+$ on the right hand side.
^[[:alpha:]]+$ means the pattern should start
^ with alphabets
[[:alpha:]] and can have one or more occurrence
+ and end
$
Yes you can use arrays instead for comparison.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Folks,
I'm using bash script. I would like to check whether input is a number or not.(Only positive numbers).. if space or non numeric is entered, it should say "invalid input". pls help..
thanks in adv.
Br///
Vijay. (1 Reply)
Discussion started by: Vijayakumarpc
1 Replies
2. Shell Programming and Scripting
Hi,
I have a 5 gig file, no record terminators, field terminators are newline. The record length is 768 and I would like to check that every 768th byte is a newline and print out the byte position if it isn't. I would like to do this going either forward or backwards with one command if... (3 Replies)
Discussion started by: vtischuk@yahoo.
3 Replies
3. Shell Programming and Scripting
the script on excution should take a directory path from useran a numric input and it should check indicate whether its write or not?
if the cmmd sh<script-name>,dir/path.<500>" is greater than 500 in size should be copied to dir ,temp in pwd and display the mesage'files of 2000 bytes hav been... (4 Replies)
Discussion started by: arukr
4 Replies
4. Shell Programming and Scripting
hi everybody,
I need a quick help with this issue. I have configuration file in which the following set of strings must be present. I need to check it with the bash script (leading spaces are not significant). Check must be case insensitive. Can anybody help?
... any lines
<SECTION... (4 Replies)
Discussion started by: sameucho
4 Replies
5. Homework & Coursework Questions
1. The problem statement, all variables and given/known data:
The script usage will be as follows:
library.third source_directory
- Your script will display an appropriate error message and exit with status 3 if no parameters are given
- Your script will display an appropriate error... (2 Replies)
Discussion started by: netmaster
2 Replies
6. Shell Programming and Scripting
I need to check if an account has a valid password.
Would something like this work?
read ACCNAME
if grep -q "^$ACCNAME:\$6:" /etc/shadow; thenI noticed every entry in my shadow file that has a password starts with $6 ... it works for my current setup, but would it always work? I can't test... (4 Replies)
Discussion started by: ADay2Long
4 Replies
7. Shell Programming and Scripting
How to check the user input to be valid using shell script?
The valid input is in the format like as follows.
1. It can only have r,w,x or a hyphen and nothing else.
2. ensure the r, w, x are in the correct order.
for example: rwxr-xr-x is a valid format.
Thanks (5 Replies)
Discussion started by: hyeewang
5 Replies
8. Shell Programming and Scripting
Hi all,
I have date and time value in a string,
I want to check if it is a valid date and time.
Need help on this.
Thanks (7 Replies)
Discussion started by: Pratiksha Mehra
7 Replies
9. Shell Programming and Scripting
How can I validate if time (HH:MM:SS) argument is valid? I got this from web but I can't modify it to exit the script if the time argument is invalid.
echo $1 | awk -F ':' '{ print ($1 <= 23 && $2 <= 59 && $3 <= 59) ? "good" : "bad" }'
ex:
./script.ksh 12:34:21 = okay
./script.ksh... (10 Replies)
Discussion started by: erin00
10 Replies
10. Shell Programming and Scripting
Hello,
I am trying to develop a script to check for valid hostnames. Below are the prerequisites for a valid hostname which I got from wiki :
Hostnames are composed of series of labels concatenated with dots, as are all domain names. For example, "en.wikipedia.org" is a hostname. Each label... (8 Replies)
Discussion started by: rahul2662
8 Replies
LEARN ABOUT MOJAVE
mpsmatrixsolvetriangular
MPSMatrixSolveTriangular(3) MetalPerformanceShaders.framework MPSMatrixSolveTriangular(3)
NAME
MPSMatrixSolveTriangular
SYNOPSIS
#import <MPSMatrixSolve.h>
Inherits MPSMatrixBinaryKernel.
Instance Methods
(nonnull instancetype) - initWithDevice:right:upper:transpose:unit:order:numberOfRightHandSides:alpha:
(void) - encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:
Additional Inherited Members
Detailed Description
MPSMatrixSolve.h MetalPerformanceShaders.framework
Copyright:
Copyright (c) 2016 Apple Inc. All rights reserved. MetalPerformanceShaders filter base classes
This depends on Metal.framework.
A kernel for computing the solution of a linear system of equations using a triangular coefficient matrix.
A MPSMatrixSolveTriangular finds the solution matrix to the triangular system:
op(A) * X = alpha * B or X * op(A) = alpha * B
Where A is either upper or lower triangular and op(A) is A**T or A. B is the array of right hand sides for which the equations are to be
solved. X is the resulting matrix of solutions.
Method Documentation
- (void) encodeToCommandBuffer: (nonnull id< MTLCommandBuffer >) commandBuffer(MPSMatrix *__nonnull) sourceMatrix(MPSMatrix *__nonnull)
rightHandSideMatrix(MPSMatrix *__nonnull) solutionMatrix
Encode a MPSMatrixSolveTriangular kernel into a command Buffer.
Parameters:
commandBuffer A valid MTLCommandBuffer to receive the encoded filter
sourceMatrix A valid MPSMatrix containing the source matrix.
rightHandSideMatrix A valid MPSMatrix containing the right hand side values.
solutionMatrix A valid MPSMatrix to contain the result.
This function encodes the MPSMatrixSolveTriangular object to a valid command buffer.
rightHandSideMatrix and solutionMatrix must be large enough to hold at least order * numberOfRightHandSides values starting at
secondarySourceMatrixOrigin and resultMatrixOrigin respectively.
sourceMatrix must be at least size order x order starting at primarySourceMatrixOrigin.
- (nonnull instancetype) initWithDevice: (nonnull id< MTLDevice >) device(BOOL) right(BOOL) upper(BOOL) transpose(BOOL) unit(NSUInteger)
order(NSUInteger) numberOfRightHandSides(double) alpha
Initialize an MPSMatrixSolveTriangular object on a device
Parameters:
device The device on which the kernel will execute.
right A boolean value which indicates if the coefficient matrix is multiplied on the left or right side of the solution. NO indicates
the multiplication is on the left.
upper A boolean value which indicates if the source is lower or upper triangular. NO indicates that the coefficient matrix is lower
triangular.
transpose A boolean value which indicates if the source matrix should be used in transposed form. NO indicates that the coefficient
matrix is to be used normally.
unit A boolean value which indicates if the source matrix is unit triangular.
order The order of the source matrix and, if right == NO, the number of rows in the solution and right hand side matrices. If right ==
YES the number of columns in the solution and right hand side matrices.
numberOfRightHandSides If right == NO, the number of columns in the solution and right hand side matrices. The number of rows
otherwise.
alpha A double precision value used to scale the right hand sides.
This function initializes a MPSMatrixSolveTriangular object. It may allocate device side memory.
Returns:
A valid MPSMatrixSolveTriangular object or nil, if failure.
Author
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSMatrixSolveTriangular(3)