02-29-2012
how to assign file names to array variable?
I wish to assign file names with particular extention to array variables. For example if there are 5 files with .dat extention in /home/sam then i have to assign these 5 files to an array.
plz help me how to accomplish this.
Thanks in advance.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to assign the contents of file e.g
ls "$HOME"
into an array. If it is possible then please guide me without using the concept of awk,sed, and perl16
Thanks (10 Replies)
Discussion started by: murtaza
10 Replies
2. Shell Programming and Scripting
I am trying to write a piece of code that will call a value from an array. There are multiple arrays that I need to call data from. Only one array needs to be used based on the step within the program. The arrays have the names "cue_0", "cue_1", and so on.
I can't figure out how to call a value... (2 Replies)
Discussion started by: vockleya
2 Replies
3. Shell Programming and Scripting
Greetings folks,
I am trying to assign the output of a dscl command (contains name<spaces>id) to a variable as an array. Currently I am piping the output into a tmp file, then reading the tmp file into an array, then parsing the array. I would like to bypass creating the tmp file portion of... (6 Replies)
Discussion started by: macnetdaemon
6 Replies
4. Shell Programming and Scripting
I want to ask the user to enter an X amount of file names. I want to put those names into an array and then loop back through them to verify they are in the directory. 1st- How would I assign the value to an array and what is the correct syntax. 2nd- how would i reference that array after I... (3 Replies)
Discussion started by: tvb2727
3 Replies
5. Shell Programming and Scripting
Hi,
I have a piece of code as follows:
i=0
while read LINE
do
var = "$LINE"
i=$((i+1))
echo "${var}"
done < file
I want to assign value to the array var.
However, when i execute the script i get a error.
Please can you help me know what i am missing.
I ultimately want to... (2 Replies)
Discussion started by: sunrexstar
2 Replies
6. Shell Programming and Scripting
Hi every one.. I'm new to shell scripting... I would like to assign a single array element to a variable... Is it possible to do it....
Could any body help me.... (3 Replies)
Discussion started by: kaushik_87
3 Replies
7. Shell Programming and Scripting
Hi,
I have requirement to assign values to variables which are created dynamically.
Below is the code which i am using to achieve above requirement.
#!/bin/ksh
oIFS="$IFS"; IFS=','
STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3"
set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies
8. Shell Programming and Scripting
is it possible to assign value to an array variable from an external file?? if yes then how??
I am using below code but its not working.
#!bin/bash
myarray < file_name
echo ${mayarray} (6 Replies)
Discussion started by: mukulverma2408
6 Replies
9. UNIX for Beginners Questions & Answers
i have this basic code that i wrote to read a file and place it's values to an array. the source/input file will have multiple strings on it that is separated by a whitespace.
sample_list.txt file contents:
ACCT1 TABLE1
ACCT2 TABLE2
ACCT3 TABLE3
script file: sample_list.sh
... (3 Replies)
Discussion started by: wtolentino
3 Replies
LEARN ABOUT MOJAVE
mpsvectordescriptor
MPSVectorDescriptor(3) MetalPerformanceShaders.framework MPSVectorDescriptor(3)
NAME
MPSVectorDescriptor
SYNOPSIS
#import <MPSMatrixTypes.h>
Inherits NSObject.
Class Methods
(__nonnull instancetype) + vectorDescriptorWithLength:dataType:
(__nonnull instancetype) + vectorDescriptorWithLength:vectors:vectorBytes:dataType:
(size_t) + vectorBytesForLength:dataType:
Properties
NSUInteger length
NSUInteger vectors
MPSDataType dataType
NSUInteger vectorBytes
Detailed Description
This depends on Metal.framework
A MPSVectorDescriptor describes the length and data type of a an array of 1-dimensional vectors. All vectors are stored as contiguous
arrays of data.
Method Documentation
+ (size_t) vectorBytesForLength: (NSUInteger) length(MPSDataType) dataType
Return the recommended stride, in bytes, to be used for an array of vectors of a given length.
Parameters:
length The number of elements in a single vector.
dataType The type of vector data values.
To achieve best performance the optimal stride between vectors within an array of vectors is not necessarily equivalent to the number of
elements per vector. This method returns the stride, in bytes, which gives best performance for a given vector length.
Using this stride to construct your array is recommended, but not required (provided that the stride used is still large enough to
allocate a full vector of data).
+ (__nonnull instancetype) vectorDescriptorWithLength: (NSUInteger) length(MPSDataType) dataType
Create a MPSVectorDescriptor with the specified length and data type.
Parameters:
length The number of elements in a single vector.
dataType The type of the data to be stored in the vector.
Use this function for creating a descriptor of a MPSVector object containing a single vector.
+ (__nonnull instancetype) vectorDescriptorWithLength: (NSUInteger) length(NSUInteger) vectors(NSUInteger) vectorBytes(MPSDataType) dataType
Create a MPSVectorDescriptor with the specified length and data type.
Parameters:
length The number of elements in a single vector.
vectors The number of vectors in the MPSVector object.
vectorBytes The number of bytes between starting elements of consecutive vectors.
dataType The type of the data to be stored in the vector.
For performance considerations the optimal stride between vectors may not necessarily be equal to the vector length. The
MPSVectorDescriptor class provides a method which may be used to determine this value, see the vectorBytesForLength API.
Property Documentation
- dataType [read], [write], [nonatomic], [assign]
The type of the data which makes up the values of the vector.
- length [read], [write], [nonatomic], [assign]
The number of elements in the vector.
- vectorBytes [read], [nonatomic], [assign]
The stride, in bytes, between corresponding elements of consecutive vectors. Must be a multiple of the element size
- vectors [read], [nonatomic], [assign]
The number of vectors.
Author
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSVectorDescriptor(3)