11-17-2009
Thank you for the reply,
but the input is not the one which i gave i will be given a comma separated
for ex: ./Test.sh a,10,b,20,c,30
after this the input has to be taken in the array and at last the o/p to be
a=10
b=20
c=30
my input is not ./Test.sh a 10 b 20 //no this is no my input
my input is ./Test.sh a,10,b,20...
i want to get the o/p from an array,
please help.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
Following is the code . When I give input as Bangalore,its dospalying Welcome to Hitech City. But say , if I select Delhi or US, its not displaying the corresponding message. Its still says Welcome to Hitech City.
Seems that it not entering in the elif part. Please suggest.
#!... (4 Replies)
Discussion started by: pankajkrmishra
4 Replies
2. Shell Programming and Scripting
I just want to write a little script, that reads the lines from a file, echos somthing in a new tmp.file and then do some commands whith the tmp.files.
while read -r line
do
echo "TEST=" > tmp.$$
echo "$line" >> tmp.$$
any_command < tmp.$$
done < $INPUTFILE
But I think I have to... (2 Replies)
Discussion started by: elifchen
2 Replies
3. Shell Programming and Scripting
Hi everyone,
I have n number of data in my file "temp" in following order.In each line table_name and
column_name are different.input data is in same format each query in three lines.
ALTER TABLE table_name
ADD ( column_name1 VARCHAR2(10),
column_name2 VARCHAR2(70) );
... (23 Replies)
Discussion started by: alisha
23 Replies
4. Shell Programming and Scripting
Hi all,
i write a script c shell
set i = 1
while ( $i <= $#array )
echo "$array"
@ i++
end
i want to set it to i = i +2 in that statement . Can anybody help me?
---------- Post updated at 02:46 PM ---------- Previous update was at 02:35 PM ----------
anybody not how to solve it??? (2 Replies)
Discussion started by: proghack
2 Replies
5. Shell Programming and Scripting
Hello I am very new to shell and I bought some books and trying to learn it. I started trying to write a script that will take a number and count it down to 1 with commas in between. This number can only be one argument. If lower than one or higher than one argument it sends an error message. ... (4 Replies)
Discussion started by: zero3ree
4 Replies
6. Shell Programming and Scripting
I am looking to a solution to the following problem. I have a very large file that looks something like this:
Each group of three numbers on each line are three probabilities that sum to one.
I want to output the maximum for each group of three. So desired output would be:
or... (6 Replies)
Discussion started by: hydrabane
6 Replies
7. Shell Programming and Scripting
Hi,
I have multiple files in a directory. Each file will have a header.I have to check if any of the files has 0 rows other than the header then I have to delete the files.
Here “ Empty file” in my case means a file has header information but no data. I have to delete such files.
If the file... (2 Replies)
Discussion started by: ganesnar
2 Replies
8. Shell Programming and Scripting
Hi Friends, I have a file. the content is as below:
file1:
/A/B/C/abc.txt
2013-07-28 13:50:00,2013-07-31 01:00:00,5,710
/A/B/C/xyz.txt
2011-09-21 18:30:00,2013-07-30 06:15:00,15,65135
2009-11-09 18:00:00,2011-09-02 09:00:00,5,12345
2013-07-28 13:50:00,2013-07-31 01:00:00,5,710
... (2 Replies)
Discussion started by: vsachan
2 Replies
9. Shell Programming and Scripting
Hi
I have written a shell script which will test 300 to 500 IPs to find which are pinging and which are not pinging.
the script which give output as
10.x.x.x is pining
10.x.x.x. is not pining
-
-
-
10.x.x.x is pining
like above.
But, this script is taking... (6 Replies)
Discussion started by: kumar85shiv
6 Replies
10. Shell Programming and Scripting
I want to create a shell script to add a user and modify its comment field mentioned in a file.
1.
File value:-
username comment field value
xyz123 xyztesting
abc123 abctesting
def123 deftesting
2. i am using below loop to create user... (2 Replies)
Discussion started by: Anil
2 Replies
LEARN ABOUT DEBIAN
test::lectrotest::failurerecorder
Test::LectroTest::FailureRecorder(3pm) User Contributed Perl Documentation Test::LectroTest::FailureRecorder(3pm)
NAME
Test::LectroTest::FailureRecorder - Records/plays failures for regression testing
SYNOPSIS
use Test::LectroTest::Recorder;
my $recorder = Test::LectroTest::Recorder->new("storage_file.txt");
my $recorder->record_failure_for_property(
"property name",
$input_hashref_from_counterexample
);
my $failures = $recorder->get_failures_for_property("property name");
for my $input_hashref (@$failures) {
# do something with hashref
}
DESCRIPTION
This module provides a simple means of recording property-check failures so they can be reused as regression tests. You do not need to use
this module yourself because the higher-level LectroTest modules will use it for you when needed. (These docs are mainly for LectroTest
developers.)
The basic idea is to record a failure as a pair of the form
[ <property_name>, <input hash from counterexample> ]
and Dump these pairs into a text file, each record terminated by blank line so that the file can be read using paragraph-slurp mode.
The module provides methods to add such pairs to a recorder file and to retrieve the recorded failures by property name. It uses a cache
to avoid repetitive reads.
METHODS
new(storage-file)
my $recorder = Test::LectroTest::Recorder->new("/path/to/storage.txt");
Creates a new recorder object and tells it to use storage-file for the reading and writing of failures.
The recorder will not access the storage file until you attempt to get or record a failure. Thus it is OK to specify a storage file that
does not yet exist, provided you record failures to it before you attempt to get failures from it.
get_failures_for_property(propname)
my $failures = $recorder->get_failures_for_property("property name");
for my $input_hashref (@$failures) {
# do something with hashref
while (my ($var, $value) = each %$input_hashref) {
# ...
}
}
Returns a reference to an array that contains the recorded failures for the property with the name propname. In the event no such failures
exist, the array will be empty. Each failure is represented by a hash containing the inputs that caused the failure.
If the recorder's storage file does not exist or cannot be opened for reading, this method dies. Thus, you should call it from within an
"eval" block.
record_failure_for_property(propname, input-hashref)
my $recorder->record_failure_for_property(
"property name",
$input_hashref_from_counterexample
);
Adds a failure record for the property named propname. The record captures the counterexample represented by the input-hashref. The
record is immediately appended to the recorder's storage file.
Returns 1 upon success; dies otherwise.
If the recorder's storage file cannot be opened for writing, this method dies. Thus, you should call it from within an "eval" block.
SEE ALSO
Test::LectroTest::TestRunner explains the internal testing apparatus, which uses the failure recorders to record and play back failures for
regression testing.
LECTROTEST HOME
The LectroTest home is http://community.moertel.com/LectroTest. There you will find more documentation, presentations, mailing-list
archives, a wiki, and other helpful LectroTest-related resources. It's also the best place to ask questions.
AUTHOR
Tom Moertel (tom@moertel.com)
COPYRIGHT and LICENSE
Copyright (c) 2004-06 by Thomas G Moertel. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.3 2007-08-30 Test::LectroTest::FailureRecorder(3pm)