05-01-2014
So you are want to step through pairs of numbers then rather than to display all four combinations (or however many there may be)
The loop as written is working fine, but it's clearly not the logic you want. What is the relationship between the two numbers? There are all sorts of ways that this could be achieved, but the key to choosing a suitable way is to know why we need the values and how they are related. Can you elaborate?
Thanks,
Robin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
Working on AIX using the following for loop.
for a in `find /edi/iTracTEST/sessions -name nohup.out -print`
do
echo $a
done
On the command line it works fine, but insert the code in a file and then running it, it does not want to work. I get the following back.
' is not... (3 Replies)
Discussion started by: hugow
3 Replies
2. Shell Programming and Scripting
hi friends,
i wrote one simple shell script.. in that am using for loop... when i am trying to execute the script.it shows syntax error at for loop line '((' unexpected.
#!/bin/ksh
##
##### To find no of files in the directory
NOF=`ls -l /root/COMM/LOGS/eds/20081025| wc -l`... (5 Replies)
Discussion started by: rdhaprakasam
5 Replies
3. Solaris
Hi,
Iam trying to add a while loop in my script in the below way which gets value from count file and checks if its not equal to 0.If yes then it shld echo me a message.
while //count file has some number other than 0
do
echo "count is not zero"
done
But iam getting this error:... (5 Replies)
Discussion started by: jyothi_wipro
5 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I get the following output
98 -1
98 0
./get_AB04-time: line 79: ((: i< && 0 !=7 : syntax error: operand expected (error token is "&& 0 !=7 ")
I have this part of code. Line 79 is the line of the for loop.
echo ${OCCURRENCE} $i_START
CASE=0;
i_END=${i_START}... (4 Replies)
Discussion started by: f_o_555
4 Replies
5. Shell Programming and Scripting
Hello All,
I am having a problem with an “if loop” within a “while loop” in my Korn Shell program. The basic concept of the program is that it searches for the existence of a series of load files in a load directory, and once it finds one of these files, it begins the following process:
· Creates... (4 Replies)
Discussion started by: jonesdk5
4 Replies
6. Shell Programming and Scripting
the program just prints all the command line arguments
Getting error in the program
error
./hellow: line 13: 0: command not found
./hellow: line 13: 0: command not found
below is the program
#!/bin/bash
num=$#
echo $num
if
then
echo "No arguments are passed ."
else
... (7 Replies)
Discussion started by: BHASKARREDDY006
7 Replies
7. Shell Programming and Scripting
I have a file Table.out having table name like this
Table_Emp
Table_Exp
Table_Fcr
To show first 10 rows .. I' wrtng a script like this ..
#!/bin/ksh
cat /tmp/table.out|while read -r table vbar1
do
<connect to db>
then
select * from $table limit 10; > /tmp/1.out
done
... (3 Replies)
Discussion started by: netdbaind
3 Replies
8. Shell Programming and Scripting
Hi All,
while executing this code ,I'm gettign below Error
if_test: line 3:
#!/bin/bash
if ;
then
echo "this is aginity;"
elif ;
then
echo "this is informatica;"
fi
exit (3 Replies)
Discussion started by: netdbaind
3 Replies
9. Shell Programming and Scripting
This is my first ever bash script. What i wish to achieve is to find all files in current directory except the script file and count lines in each found file. Some thing seems to be wrong with the if statement :confused: Please help why it does not work? and maybe you have some ideas how to improve... (3 Replies)
Discussion started by: chinababy
3 Replies
10. UNIX for Beginners Questions & Answers
There are two files abc_123.dat and abc_345.dat if at least one file exists then enter into the loop and remove file and exit.
In first iteration, deleting files successfully
but "else" statement executing after deleting files."else" should execute only if there is no file in the directory.... (1 Reply)
Discussion started by: Rajesh123
1 Replies
LEARN ABOUT DEBIAN
mon::protocol
Mon::Protocol(3pm) User Contributed Perl Documentation Mon::Protocol(3pm)
NAME
Mon::Protocol - Methods for parsing / dumping a protocol block
SYNOPSIS
use Mon::Protocol;
DESCRIPTION
METHODS
new Creates a new object. A hash can be supplied which sets the default values. An example which contains all of the variables that you can
initialize:
$c = new Mon::Protocol;
dump_data
Returns the current internal structure as a string dump suitable for passing to "parse_data".
"parse_data"
Parses a command block (from begin_block to end_block), as generated by dump_data.
"type"(new_type)
Sets or returns the type of the current command block. See @TYPES for valid type codes.
In the future, it is possible that this module will perform additional checking based on the type, for now it is left to the
application to interpret this.
"get_section_list"
Returns an array containing all section names within the block.
"get_section"(section_name)
Returns a hash containing the key/value pairs of the specific section.
"delete_section"(section_name)
Completely removes the specified section from the block.
"add_to_section"(section_name,$hash_ref)
Adds the key/value pairs in the hash to the specified section.
$foo->add_to_section("_hostgroup", { "ns1.baz.com" -> "ok" });
"delete_from_section"(section_name,$key)
Deletes the key/value pair from the section.
$foo->delete_from_section("_hostgroup", "ns1.baz.com");
"error"
Should any of the functions return an error (-1), this function can be used to retrieve a more elaborate error message and to reset the
internal error state.
perl v5.14.2 2012-04-27 Mon::Protocol(3pm)