05-08-2018
Change the plus to a minus in the Error 402 check condition.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
my shell script is simple arithmetic process.my addtion,substract and divide all can be worked only except multiplication.please help me.the shell is following:
#!/usr/bin/sh
echo "enter a number1:"
read number1
echo "enter an operator:"
read operator
echo "enter a number2:"
read number2... (4 Replies)
Discussion started by: sonicstage
4 Replies
2. Shell Programming and Scripting
hi all,
in ksh, is there a way to throw a generic error message. i have lots of commands in my script and i didnt want to put
if ; then
doStuff();
else
print "an error occured, please run script again";
fi
around all the commands used. is there a way detect a command has... (1 Reply)
Discussion started by: cesarNZ
1 Replies
3. Shell Programming and Scripting
Suppose i have a file A
1*2*3*4
2*4*4*22
and second file B
2*3*4*5
4*4*6*7
By multiplying file A by file B that is file A by first column in file B respectively
output shud be
2*6*12*20
8*16*24*154
my code is
=$1
next
}
{for (f=1;f<=NF;f++) (2 Replies)
Discussion started by: cdfd123
2 Replies
4. UNIX for Dummies Questions & Answers
I want to count the number of lines in a file and store it in a variable if this count is zero i hv to throw an error ...is this syntax correct , but i am not getting the desired result
I am not using -s option here as i am concerned about record count not the size
#!/bin/ksh
set $count1... (4 Replies)
Discussion started by: mavesum
4 Replies
5. Shell Programming and Scripting
Hi,
I wanted to write a schell program that fetches the values from a file and prints the output as its onerall multiplication.
for example I have a file named abc. it has values 2, 3, 4
now my program should give me 2*3*4 ie 24.
note:this file abc can have any numbers.
so experts,... (9 Replies)
Discussion started by: sandeep.krish
9 Replies
6. Shell Programming and Scripting
Hi I have script that is developed to serch for 30 days old Directory & Files and then remove them ...
when i run it successfully removes the Directory & files & but it throw errors on the screen
..
..
+ find . -type f -mtime +30 -exec rm -f {} ;
+ exit
please help me ??
I... (0 Replies)
Discussion started by: Beginner123
0 Replies
7. Shell Programming and Scripting
#!/bin/sh
echo Enter the multiplication number required:
read number
for i in 1 2 3 4 5 6 7 8 9 10
do
echo "$number * $i = expr $number \* $i"
done
I am not getting the output for this multiplication table. (4 Replies)
Discussion started by: vinodpaw
4 Replies
8. Shell Programming and Scripting
Hi,
I have a requirement like i have to search a script and find names that conatins more than two dots, if so then throw error.
For ex: a1.b1.comname here i have to find comname and check two dots. it will not throw error
a1.b1.c1.comname here it contains more than 2dots it will throw... (3 Replies)
Discussion started by: swagat123
3 Replies
9. Shell Programming and Scripting
Hi,
I have two files (file1.txt, file2.txt) in which, I would like to multiply all the values in file1 with the first row value of file2, file1 * second row value of file2, file1 * third row value of file2 and so on.
Below are my sample data.
file1.txt file2.txt ... (6 Replies)
Discussion started by: ida1215
6 Replies
10. UNIX for Dummies Questions & Answers
Hello,
I am trying to compute the percentage in a script as shown below:
PerCover=`echo "scale=2 ; 100 \* ($InputCover/$Total)" | bc`
However the PerCover value is blank/null. What do I need to do differently?
Thanks for your input!
~Guss (1 Reply)
Discussion started by: Gussifinknottle
1 Replies
LEARN ABOUT DEBIAN
throwable::error
Throwable::Error(3pm) User Contributed Perl Documentation Throwable::Error(3pm)
NAME
Throwable::Error - an easy-to-use class for error objects
VERSION
version 0.102080
SYNOPSIS
package MyApp::Error;
use Moose;
extends 'Throwable::Error';
has execution_phase => (
is => 'ro',
isa => 'MyApp::Phase',
default => 'startup',
);
...and in your app...
MyApp::Error->throw("all communications offline");
# or...
MyApp::Error->throw({
message => "all communications offline",
phase => 'shutdown',
});
DESCRIPTION
Throwable::Error is a base class for exceptions that will be thrown to signal errors and abort normal program flow. Throwable::Error is an
alternative to Exception::Class, the features of which are largely provided by the Moose object system atop which Throwable::Error is
built.
Throwable::Error performs the Throwable and StackTrace::Auto roles. That means you can call "throw" on it to create and throw n error
object in one call, and that every error object will have a stack trace for its creation.
ATTRIBUTES
message
This attribute must be defined and must contain a string describing the error condition. This string will be printed at the top of the
stack trace when the error is stringified.
stack_trace
This attribute, provided by StackTrace::Auto, will contain a stack trace object guaranteed to respond to the "as_string" method. For more
information about the stack trace and associated behavior, consult the StackTrace::Auto docs.
METHODS
as_string
This method will provide a string representing the error, containing the error's message followed by the its stack trace.
AUTHORS
o Ricardo SIGNES <rjbs@cpan.org>
o Florian Ragwitz <rafl@debian.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.10.1 2010-07-27 Throwable::Error(3pm)