10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello all,
I have 2 very long list of elements. f.e.:
List 1
1 2 3 4 5
List 2
a b c
How can I combine the two with other. Like this:
1 a
1 b
1 c
2 a
2 b
2 c
3 a
etc. (21 Replies)
Discussion started by: mrAibo
21 Replies
2. Shell Programming and Scripting
Hi all,
I have a script with the following gist:
declare -a index=(0 1 2 3 4);
declare -a animals=(dog cat horse penguin cow);
declare -a fruits=(orange apple grapes peach mango);
declare -a drinks=(juice milk coffee tea coke);
declare -a cities=(toronto paris london glasgow... (18 Replies)
Discussion started by: Kingzy
18 Replies
3. Shell Programming and Scripting
I have the following code and for some reason when I call the program using
/home/tcdata/tatsh/trunk/hstmy/bin/bash/raytrac.bash --cmod=jcdint.cmod
I get
hasArgument =
hasArgument = true
Somehow the array element is returning even though I have not chosen the option.
... (41 Replies)
Discussion started by: kristinu
41 Replies
4. Shell Programming and Scripting
In one session I have strange behavior of the bash-shell:
SDX-Q> echo ">$ss<" #this is just to present the $ss var:
> lll kkk <
SDX-Q> # more obviose:
SDX-Q> od -cb <<<"$ss"
0000000 l l l k k k \n
040 040 040 154 154 154 040... (3 Replies)
Discussion started by: alex_5161
3 Replies
5. Shell Programming and Scripting
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
Discussion started by: boy18nj
5 Replies
6. Shell Programming and Scripting
Hi all,
I have a file that contains many lines, but only a few are of my interest, so I'm cutting it with grep + awk, and the result I get is for example
line 0
line 1
line 2
line 3
line n
Now I want to store each line in an array "cell" so I can use it later calling to
${array},... (2 Replies)
Discussion started by: TuxSax
2 Replies
7. Shell Programming and Scripting
hi i am using bash shell to perform some subraction. here is what i have:
i have a while loop and am using i as a counter.
diff= `expr ${ARRAY1} - ${ARRAY2}`
for example array1 has -0.7145 and array2 has -0.7041.
when i try the above command, i get expr: non-numeric argument. any... (6 Replies)
Discussion started by: npatwardhan
6 Replies
8. Shell Programming and Scripting
hi guys,
i have the following script and when i run it i get blank lines on the screen.. i am trying to display the contents of array var..
#!/usr/bin/bash
var=`awk 'NR>20&&NR<31' try.sum | awk '{print $4}'`
echo "${var}" (1 Reply)
Discussion started by: npatwardhan
1 Replies
9. Shell Programming and Scripting
:confused:
Is it possible to delete array elements dynamically.For instance,consider an array( a b c d ) ,now can i delete array (the third element 'c').So that the array becomes array(a b d)..
Thanks in advance!! (1 Reply)
Discussion started by: tj23
1 Replies
10. UNIX for Dummies Questions & Answers
Does anyone of you know how to turn off color and weird characters on bash shell when using the command "script"? Everytime users on my server used that command to record their script, they either couldn't print it because lp kept giving the "unknown format character" messages or the print paper... (1 Reply)
Discussion started by: Micz
1 Replies