10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello experts,
I wish to print the contents of odd-even numbered indices of an array.
The problem statement is as follows :
1. The first line contains an integer, (the number of test cases).
2. Each line of the subsequent lines containing a string.
Example:
2
Haider
Bash
... (4 Replies)
Discussion started by: H squared
4 Replies
2. Shell Programming and Scripting
Hi All,
need help with reading the array and sum of the array elements.
given an array of integers of size N . You need to print the sum of the elements in the array, keeping in mind that some of those integers may be quite large.
Input Format
The first line of the input consists of an... (1 Reply)
Discussion started by: nishantrefound
1 Replies
3. UNIX for Dummies Questions & Answers
Hello,
In a shell script, I want to declare an array and subsequently print the elements with tab delimits.
My array has the following structure and arbitrary elements:
myArray=('fgh' 'ijk' 'xyz' 'abc');
Next, I would like to print it with a '\n' at the end.
Thanks for your input!
... (2 Replies)
Discussion started by: Gussifinknottle
2 Replies
4. Shell Programming and Scripting
Hi I have two arrays :
@arcb= (450,625,720,645);
@arca=(625,645);
I need to remove the elements of @arca from elements of @arcb so that the content of @arcb will be (450,720).
Can anyone sugget me how to perform this operation?
The code I have used is this :
my @arcb=... (3 Replies)
Discussion started by: rkrish
3 Replies
5. Shell Programming and Scripting
i have an array (with each element length "n") which is dynamic and has alphanumeric characters.
i want to check if any of the elements of the array are null and replace it with a string of "n" zeros for that element.
can you suggest me a code for the same. (1 Reply)
Discussion started by: mumbaiguy07
1 Replies
6. UNIX for Dummies Questions & Answers
Is there a way to print multiple array elements without iterating through the array using bash?
Can you do something like...
echo ${array}and get all those separate elements from the array? (2 Replies)
Discussion started by: jrymer
2 Replies
7. Shell Programming and Scripting
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
Discussion started by: dgmm
3 Replies
8. Shell Programming and Scripting
Hi Guys,
I have an array which has numbers including blanks as follows:
1
26
66
4.77
-0.58
88
99
11
12
333
I want to print a group of three elements as a different column in a file as follows:(including blanks where there is missing elements) for.e.g. array element #7... (4 Replies)
Discussion started by: npatwardhan
4 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I am writing a BASH shell script. I have an array that will contain IN ANY ORDER the following elements: DAY 8D MO NS.
I would like to erase the element DAY, but since the order of the elements in the array are random, I will not know which element # DAY is (ie it's not as simple as... (3 Replies)
Discussion started by: msb65
3 Replies
10. Shell Programming and Scripting
Hi,
Please can someone help to return the array elements from a function. Currently the problem I face is that tempValue stores the value in myValue as a string while I need an array of values to be returned instead of string.
Many Thanks,
Sudhakar
the function called is:
... (5 Replies)
Discussion started by: Sudhakar333
5 Replies