10-18-2012
Afraid not. "${STRING:$N:1}" works fine, though.
This User Gave Thanks to Corona688 For This Post:
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I have file abc.txt which has keys and emails addresses
abc.txt
emailkey1:sam@abc.com
emailkey1:tom@abc.com
emailkey2:rqw@abc.com
emailkey2:tut@abc.com
I have a shell script where i pass key as the parameter and i want all the email addresses within that key concatenated by a comma... (21 Replies)
Discussion started by: samit_9999
21 Replies
2. Shell Programming and Scripting
I have a set of variables:
f1="./someFolder"
.
.
f10="./someOtherFolder"
And I'm trying to use the following loop
for (( i = 0; i <= 10; i++ ))
do
temp=f$i
done
I'm trying the get the values from my set of variable to make directories, but I can't seem the get those value... (3 Replies)
Discussion started by: kriuz
3 Replies
3. Shell Programming and Scripting
- I m retreving values from database and wish to use those values later in my shell script. I m placing these values in an array da_data but outside loop array is empty.Problem is its treating array as local inside loop hence array is empty outside loop.
Plz go through the script and suggest how... (1 Reply)
Discussion started by: Devesh5683
1 Replies
4. Shell Programming and Scripting
I need to do something like this:
for i in 1 2 3 4 5; do
arr=$(awk 'NR="$i" { print $2 }' file_with_5_records)
done
That is, parse a file and assign values to an array in an ascending order relative to the number of record in the file that is being processed on each loop.
Is my... (2 Replies)
Discussion started by: fiori_musicali
2 Replies
5. Shell Programming and Scripting
I'm a programming noob. I'm trying to run a memory intensive process for many files. But when I use the following script, it runs fine for the first 5-7 files, then runs out of memory. Monitoring the output files, it's clear the processes are going on in parallel. Once 5-7 of the files are being... (18 Replies)
Discussion started by: pathunkathunk
18 Replies
6. Shell Programming and Scripting
Here's my code:
awk -F '' 'NR==FNR {
if (/time/ && $5>10)
A=$2" "$3":"$4":"($5-01)
else if (/time/ && $5<01)
A=$2" "$3":"$4-01":"(59-$5)
else if (/time/ && $5<=10)
A=$2" "$3":"$4":0"($5-01)
else if (/close/) {
B=0
n1=n2;
... (2 Replies)
Discussion started by: klane
2 Replies
7. Shell Programming and Scripting
Hi All
I am trying to fetch the size of three files into three separate variables within a for loop and am doing something like this:
for i in ATT1 ATT2 ATT3
do
size_$i=`ls -ltr $i | awk '{print $5}'`
echo ${size_$i}
done
but am getting the below error:
ksh: size_ATT1=522: not... (3 Replies)
Discussion started by: swasid
3 Replies
8. Shell Programming and Scripting
array=( 8 5 6 2 3 4 7 1 9 0 )
for i in "${array}"
do
echo $i
done
# i need the output like this by swapping of array values
0
9
1
7
4
3
2
6
5
8 (7 Replies)
Discussion started by: Meeran Rizvi
7 Replies
9. Shell Programming and Scripting
I have a headerless array of 1000 columns x 100000 rows. The array only contains 4 values; 0/0, 0/1, 1/1, ./.
Here I am showing the 1st 3 rows and columns of the input array
0/0 0/0 1/1
0/1 0/1 0/1
0/0 ./. 0/0
0/0 0/0 0/0
I would like to convert the values in... (9 Replies)
Discussion started by: Geneanalyst
9 Replies
10. Shell Programming and Scripting
Hello!
I'm making an English to Morse Code translator and I was able to mostly get it all working by looking through older posts here; however, I have one small problem.
When I run it it's just printing spaces for where the characters should be. It runs the right amount of times, and if I try... (3 Replies)
Discussion started by: arcoleman10
3 Replies
LEARN ABOUT DEBIAN
excel::template::container::loop
Excel::Template::Container::Loop(3pm) User Contributed Perl Documentation Excel::Template::Container::Loop(3pm)
NAME
Excel::Template::Container::Loop - Excel::Template::Container::Loop
PURPOSE
To provide looping
NODE NAME
LOOP
INHERITANCE
Excel::Template::Container
ATTRIBUTES
o NAME
This is the name of the loop. It's used to identify within the parameter set what variables to expose to the children nodes each
iteration.
CHILDREN
None
EFFECTS
None
DEPENDENCIES
None
USAGE
<loop name="LOOPY">
... Children here ...
</loop>
In the above example, the children nodes would have access to the LOOPY array of hashes as parameters. Each iteration through the array
would expose a different hash of parameters to the children.
These loops work just like HTML::Template's loops. (I promise I'll give more info here!)
There is one difference - I prefer using Perl-like scoping, so accessing of variables outside the LOOP scope from within is perfectly
acceptable. You can also hide outside variables with inner values, if you desire, just like Perl.
AUTHOR
Rob Kinyon (rob.kinyon@gmail.com)
SEE ALSO
perl v5.14.2 2012-04-29 Excel::Template::Container::Loop(3pm)