10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have an array in an external file, "array.txt", which contains:
char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies
2. UNIX for Beginners Questions & Answers
Hi There
Just created a .sql script and executes fine, it comes back with two lines of results, I was wondering is there a way of adding up the two results to get a round number. I tired wc -l but that didn't work.
Many Thanks for your help
psql -t -f... (3 Replies)
Discussion started by: simpsa27
3 Replies
3. Programming
Can C add its results into an array like bash? For example using bash:
cat /etc/passwd
**truncated for space **
gdm:x:109:118:Gnome Display Manager:/var/lib/gdm:/bin/false
mysql:x:110:122:MySQL Server,,,:/nonexistent:/bin/false
statd:x:111:65534::/var/lib/nfs:/bin/false... (5 Replies)
Discussion started by: metallica1973
5 Replies
4. Shell Programming and Scripting
for a in {1..100}
do
awk '{ sum+=$a} END {print sum}' a=$a file1 > file2
done
I know I will get only one number if following the code above, how can I get 100 sum numbers in file2? (2 Replies)
Discussion started by: wanliushao
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am trying to use awk to do the following:
For a column:
5
3
4
2
7
I want to start with the first entry then add the second to the first, third to second ..etc:
5
8
12
14
21 (5 Replies)
Discussion started by: cosmologist
5 Replies
6. Shell Programming and Scripting
Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh.
I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
3 Replies
7. Shell Programming and Scripting
Hi there
If I run a 'swap -l' on my solaris box, i get
swapfile dev swaplo blocks free
/dev/dsk/c1t0d0s1 54,65 8 67119560 65655144
/dev/dsk/c1t0d0s2 54,65 8 33119522 32655122
I wanted to run a for loop adding up the totals of each column 4 , excluding the... (2 Replies)
Discussion started by: hcclnoodles
2 Replies
8. Shell Programming and Scripting
I am looking to search a directory for a folder or file and when it finds any hits I want it to store those hits in an array so I can work with those hits later on.
I have been trying to do something like this but it isn't putting results into an array like I would like, is it syntax or is this... (8 Replies)
Discussion started by: tret
8 Replies
9. Shell Programming and Scripting
Hi,
In a kshell , i need to compare the results of two array .
each Non-match value should copy to a new array.
For example:
==========
Array one contain the following values:
A
B
C
Array two contain the following values:
C
F
A
E
After comparing this arrays , a new array should... (4 Replies)
Discussion started by: yoavbe
4 Replies
10. Shell Programming and Scripting
Hi
Can anybody tell me how can I dump the results of execution of a command into array form? For example, I want to execute:
and put each part of the result in an array element:
Thanks (2 Replies)
Discussion started by: alirezan
2 Replies