I try to get a number of elements in an array, using dynamic array name.
I need the array name to be dynamic.
The array name is constructed as 'inf_ln_$nmb', where $nmb is a file line number
So, say I have the arr 'inf_ln_4':
I do next:
Is there a way to prevent the bash-shell from treat the '$a[0]' as a substitution?
My main attempt is to copy the current dynamicaly numbered array to some staticly-named array to comfortably work with it's element
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)
Hi everyone, :)
I'm trying to make a simple C program that scans an array of chars to see if its elements are similar.
I can't understand what's wrong. Could you help me to fix this? Here is the code.
Thanks!
#include<stdio.h>
int main() {
int arr;
int i, len;
int flag =... (10 Replies)
I have a script which takes backup of some configuration files on my server. It does that by using an array which contains the complete path to the files to backup.
It copys the files to a pre defined dir. Each "program" has it's own folder, ex. apache.conf is being copied to /predefined... (7 Replies)
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)
Hi.
I am trying to populate an array using eval in the background within a function. So this function will create a list of 3 character directories from SVN and store in an array. I want to call this function when the script starts in the background unknown to the user.
The problem is that... (2 Replies)
Hi,
My doubt is how to access array elements..
Situation is as below:
#!/bin/ksh
set -x
typeset -i x=0
typeset -i y=0
typeset -i BID=0
typeset -i count=0
while ] ; do
x=`expr $x + 1`;
hwmgr show scsi > scsi.tmp
while read line; do
set... (1 Reply)
I want to get a status code array for the commands in eval.
For example,
eval "ls abc; ls def; ls $HOME"
I want to get the status code for each ls command in eval. Is there any way to make it?
Thanks. (2 Replies)
Hi,
Can anyone advise me on how to use array on Bash? I am really confuse in how eval is link to array... What i wan to do is let say i have an index of an array of 50. Store either 'N' or 'Y' or "NA" in each index. how to i go about doing it.. then lastly how to i print all the values out in... (2 Replies)