10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi there,
I'm listing files and sorting them. When I try to get length of array variable in which these files are stored I get 1 as value. That's weird.
files_info="$(find $input_dir -name "*_CHR$i.info" | sort )"
printf ${#files_info}"\n" #print length
#--loop through... (6 Replies)
Discussion started by: genome
6 Replies
2. UNIX for Advanced & Expert Users
So, I do some file processing that generates very large numbers, such as total amount GETted from a busy web cluster in a month, etc. Mawk is awesome-- fast and easy. It's awk! But, there's a fatal flaw that I'd like to overcome. Apparently, %d maxes out at 2147483647. Here's sample output,... (11 Replies)
Discussion started by: treesloth
11 Replies
3. Programming
Hello;
When I wrote a function to print out an array,
void p_array(int arr)
{
int i;
int size = sizeof(arr) / sizeof(int);
// int size = sizeof (arr) / sizeof (arr);
for (i = 0; i < size; i++)
printf("%d ", arr);
printf("\n");
}I could only print out the... (19 Replies)
Discussion started by: yifangt
19 Replies
4. Shell Programming and Scripting
Does anyone know how to find length of multi dimension array
of following type
A Afor simple array I is to do
for (i in A)n++ to find length of array but if it is multi dimension how to find the length ? (2 Replies)
Discussion started by: nex_asp
2 Replies
5. Shell Programming and Scripting
Hello All,
I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine...
My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS} )
return "1" when I know the Array is empty..?
Here is... (17 Replies)
Discussion started by: mrm5102
17 Replies
6. Shell Programming and Scripting
I would be grateful if someone could help me. I am trying to write a .sh script in UNIX.
I have the following code;
User=john
User=james
User=ian
User=martin
for x in ${User}
do
print ${#x}
done
This produces the following output;
4
5
3
6 (12 Replies)
Discussion started by: mmab
12 Replies
7. Programming
I successfully compiled code like below.
#include<stdio.h>
#include<string.h>
int main()
{
int co = 9;
char a;
strcpy(a, "hahahah");
printf("co=%d\n", co);
printf("a=%s\n", a);
return 0;
} (7 Replies)
Discussion started by: vistastar
7 Replies
8. Programming
Hi All
I want to take a Hexadecimal number as input and i want to find lenth of the input and pass it to char s ( char s ). I have a program to convert hexadecial to binary but it is taking limited input but i want to return binary number based on input. How? (1 Reply)
Discussion started by: atharalikhan
1 Replies
9. Shell Programming and Scripting
I need to implement the following logic and need some expert help from UNIX community.
These are the steps in my Shell script.
1. Analyze a file.
2. Extract all the ID's in that file.
3. Use the ID's from #2 to run another filter on the file.
I've implemented # 1 and 2 using... (3 Replies)
Discussion started by: katwala
3 Replies
10. Shell Programming and Scripting
Hi experts,
How to get the length of an Array in PERL.
for eg., @Var having 5 elements.
regards
Anent (5 Replies)
Discussion started by: anent
5 Replies