I am doing an exercise which has the following requirements.
Charlie will bite your finger exactly 50% of the time. First, write a function isBitten() that returns TRUE with 50% probability, and FALSE otherwise
To generate a webpage that displays "Charlie bit your finger!" or "Charlie did not bite your finger!" using the isBitten() function.
I have written the below and geeting error in line 11 of the below code.
Request your expert opinion to help figure out the solution.
Best Regards,
ND
Last edited by rbatte1; 05-07-2015 at 01:33 PM..
Reason: Added CODE tags
can somebody help, what quote i should use in below statement or what wrong of it ?
the 1st (*) is a char, the 2nd and 3rd (*) is a wildcard
if ] && ] && ]
................^ .............^
then
echo "ok"
fi
thanks in advance. (2 Replies)
Hi all,
The following code is to find if a list of numbers from one file are within the range in another file.
awk -F, '\
BEGIN {
while ((getline < "file2") > 0)
file2=$3
}
{for (col1 in file2)
if ($0>=30 && $1<=45)
print $0} ' FILE1
But where I have the number 30 and 45, I... (3 Replies)
Hi,
I have a script like this:
sample.sh
mapping=$1
if
then
echo "program passed"
fi
I'm running the above script as ./sample.sh pass
The script is not getting executed and says "integer expression expected"
Could anyone kindly help me? (2 Replies)
I want to combine 2 conditional statements by using -o in bash, but it won't work.
if ; then
echo "The number needs to be between 0 and $nr"
fi
Each time i execute the file it says:
./selectCitaat: line 10: syntax error near unexpected token `$1' (3 Replies)
Please see the script segment below
for i in $files
do
echo $i
if ; then
case "$1" in
"IE0263"|"IE0264"|"IE0267"|"IE0268")
short_filename=`ls -l $i | cut -c108-136 | sort`
;;
"IE0272"|"IE0273")
short_filename=`ls -l $i | cut... (4 Replies)
I need to implement something like this.
1) search for a file(say *.doc) from a path (say /home/user/temp)
2) if file found & if file size > 0 : yes --> file valid
else : print file not valid.
I am trying to implement something like this, but seems i am terribly wrong somewhere.. ... (1 Reply)
Hi all,
I have a file containing the values that would be use as the basis for printing the lines of another set of files using awk. What I want to do is something like the one below:
stdev.txt
0.21
0.42
0.32
0.25
0.15
file1.txt file2.txt file3.txt ..filen.txt
0.45 0.23 ... (4 Replies)
Hello All,
I am running source command on my project configuration file app.cfg which has conditional statements with make file systax E.g ifeq ($(APP_CMP_DIR),trunk).
When I source this file it throws error: syntax error near unexpected token... (1 Reply)
Hi,
I wanted to know if we can use conditional statements like if--else--fi inside an automated SFTP script session. (1 Reply)
Discussion started by: jhilmil
1 Replies
LEARN ABOUT DEBIAN
net::finger
Finger(3pm) User Contributed Perl Documentation Finger(3pm)NAME
Net::Finger - a Perl implementation of a finger client.
SYNOPSIS
use Net::Finger;
# You can put the response in a scalar...
$response = finger('corbeau@execpc.com');
unless ($response) {
warn "Finger problem: $Net::Finger::error";
}
# ...or an array.
@lines = finger('corbeau@execpc.com', 1);
DESCRIPTION
Net::Finger is a simple, straightforward implementation of a finger client in Perl -- so simple, in fact, that writing this documentation
is almost unnecessary.
This module has one automatically exported function, appropriately entitled "finger()". It takes two arguments:
o A username or email address to finger. (Yes, it does support the vaguely deprecated "user@host@host" syntax.) If you need to use a port
other than the default finger port(79), you can specify it like so: "username@hostname:port".
o (Optional) A boolean value for verbosity. True == verbose output. If you don't give it a value, it defaults to false. Actually, whether
this output will differ from the non-verbose version at all is up to the finger server.
"finger()" is context-sensitive. If it's used in a scalar context, it will return the server's response in one large string. If it's used
in an array context, it will return the response as a list, line by line. If an error of some sort occurs, it returns undef and puts a
string describing the error into the package global variable $Net::Finger::error. If you'd like to see some excessively verbose output
describing every step "finger()" takes while talking to the other server, put a true value in the variable $Net::Finger::debug.
Here's a sample program that implements a very tiny, stripped-down finger(1):
#!/usr/bin/perl -w
use Net::Finger;
use Getopt::Std;
use vars qw($opt_l);
getopts('l');
$x = finger($ARGV[0], $opt_l);
if ($x) {
print $x;
} else {
warn "$0: error: $Net::Finger::error
";
}
BUGS
o Doesn't yet do non-blocking requests. (FITNR. Really.)
o Doesn't do local requests unless there's a finger server running on localhost.
o Contrary to the name's implications, this module involves no teledildonics.
AUTHOR
Dennis Taylor, <corbeau@execpc.com>
SEE ALSO perl(1), finger(1), RFC 1288.
perl v5.8.8 2001-11-02 Finger(3pm)