03-18-2009
arunsoman80,
Thank you very much for your help, you suggestion for problem number 1 works fine. I will try suggestion 2 & 3 and tell you if it works.
Thanks again
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi!
I need to read in the first line from a text file (which will only ever have one line in it), so I tried this....
while read line
do
echo $line
done < $file
But this wasn't returning anything. So I tired a different file, which had multiple lines of text in it, and it returned... (2 Replies)
Discussion started by: davewg
2 Replies
2. Shell Programming and Scripting
Hi,
I have gps receiver log..its giving readings .like below
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies
3. Shell Programming and Scripting
I have a text file with hundreds of lines, i wish to run a script and reads a random line to pass it to another command line such as:
for line in `cat file |grep random line`; do echo $line |mail my@example.com ; done
thank you (6 Replies)
Discussion started by: Bashar
6 Replies
4. Shell Programming and Scripting
Hi !
I am a newbie and never officially wrote a shell script before.
The requirement for this script is :
1) Read a file called 'bpm.log' and identify if it has a specific text such as 'this is the text'. Its a static value and that is the only text we need to read.
2) If that... (2 Replies)
Discussion started by: atechcorp
2 Replies
5. Shell Programming and Scripting
Hi everyone,
I am writing a BASH shell script that I will use to process data files. I have a text file that contains the names of the files to be processed, for example:
cat filenames.txt
file1
file2
file3
file4
file5
What I would like to do is set up a FOR loop within my script... (2 Replies)
Discussion started by: msb65
2 Replies
6. Shell Programming and Scripting
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies
7. Shell Programming and Scripting
I have list of files in a directory 'dir'. Each file is of type HTML. I need to read each file and get the string which starts with 'http' and write them in a new text file. How can i do this shell scripting?
file1.html
<head>
<url>http://www.google.com</url>
</head>
file2.html
<head>... (6 Replies)
Discussion started by: vel4ever
6 Replies
8. Shell Programming and Scripting
Hi ppl.
I want to read the first word of each line of a text file to a variable in a bash script.
Can anyone help pls, thanks. (6 Replies)
Discussion started by: cannot
6 Replies
9. Shell Programming and Scripting
I have a test file that I want to read and insert only certain lines into the
the table based on a filter.
1. Rread the log file 12 Hours back Getdate() -12 Hours
2. Extract the following information on for lines that say "DUMP is
complete"
A. Date
B. Database Name
C.... (2 Replies)
Discussion started by: JolietJake
2 Replies
10. Shell Programming and Scripting
i have a text file as belows, it includes 2 columns, 1st is the column name, 2nd is the file_name
data_file.txt
column_name file_name
col1 file1
col2 file2
col3 file1
col4 file1
col5 file2
now, i would like to... (4 Replies)
Discussion started by: tester111
4 Replies
LEARN ABOUT DEBIAN
carp::always
Carp::Always(3pm) User Contributed Perl Documentation Carp::Always(3pm)
NAME
Carp::Always - Warns and dies noisily with stack backtraces
SYNOPSIS
use Carp::Always;
makes every "warn()" and "die()" complains loudly in the calling package and elsewhere. More often used on the command line:
perl -MCarp::Always script.pl
DESCRIPTION
This module is meant as a debugging aid. It can be used to make a script complain loudly with stack backtraces when warn()ing or die()ing.
Here are how stack backtraces produced by this module looks:
# it works for explicit die's and warn's
$ perl -MCarp::Always -e 'sub f { die "arghh" }; sub g { f }; g'
arghh at -e line 1
main::f() called at -e line 1
main::g() called at -e line 1
# it works for interpreter-thrown failures
$ perl -MCarp::Always -w -e 'sub f { $a = shift; @a = @$a };'
-e 'sub g { f(undef) }; g'
Use of uninitialized value in array dereference at -e line 1
main::f('undef') called at -e line 2
main::g() called at -e line 2
In the implementation, the "Carp" module does the heavy work, through "longmess()". The actual implementation sets the signal hooks
$SIG{__WARN__} and $SIG{__DIE__} to emit the stack backtraces.
Oh, by the way, "carp" and "croak" when requiring/using the "Carp" module are also made verbose, behaving like "cluck" and "confess",
respectively.
EXPORT
Nothing at all is exported.
ACKNOWLEDGMENTS
This module was born as a reaction to a release of Acme::JavaTrace by Sebastien Aperghis-Tramoni. Sebastien also has a newer module called
Devel::SimpleTrace with the same code and fewer flame comments on docs. The pruning of the uselessly long docs of this module were prodded
by Michael Schwern.
Schwern and others told me "the module name stinked" - it was called "Carp::Indeed". After thinking long and not getting nowhere, I went
with nuffin's suggestion and now it is called "Carp::Always". "Carp::Indeed" which is now deprecate lives in its own distribution (which
won't go anywhere but will stay there as a redirection to this module).
SEE ALSO
o Carp
o Acme::JavaTrace and Devel::SimpleTrace
o Carp::Always::Color
o Carp::Source::Always
Please report bugs via CPAN RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Carp-Always.
BUGS
Every (un)deserving module has its own pet bugs.
o This module does not play well with other modules which fusses around with "warn", "die", $SIG{'__WARN__'}, $SIG{'__DIE__'}.
o Test scripts are good. I should write more of these.
o I don't know if this module name is still a bug as it was at the time of "Carp::Indeed".
AUTHOR
Adriano Ferreira, <ferreira@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2005-2012 by Adriano R. Ferreira
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-04-18 Carp::Always(3pm)