I've done command-line arguments in other languages, but I'm having trouble passing a command-line argument to call SIGALRM. Basically I'm trying to make is where -s would have the number of seconds like this:
However, when I run it like the above the SIGALRM never gets called. Here is the code I have so far:
Hi
How to pass multi line text as a command line argument to a program.
(i.e)
./a.out hi this is sample 0 file1
where
hi this is sample should be stored in argv
0 in argv and so on... (3 Replies)
Hi all,
How many arguments can we pass while testing a prgm at command line..
I encountered an issue while passing 10 arguments.
For $10 its taking argument passed for $1 followed by 'zero'.
can we pass more than 9 arguments /Is there any other way.
Thanks,
rrs (6 Replies)
--------------------------------------------------------------------------------
I have this while loop and at the end I am trying to get it to tell me the last argument I entered. And with it like this all I get is the sentence with no value for $1. Now I tried moving done after the sentence... (1 Reply)
I am working on a script wherein i need the user to enter the Build ID
for eg:the command line will show
enter the build ID
Now on entering the build ID it should be assigned to @ARGV.
How can this be done.? (1 Reply)
Hi, I'm having problems with a script where I wanted every single option specified in the command line to have an argument taken with it, but for some reason only d works in the code I will be showing below.
For example if I did ./thisfile -a something
it would come up with "a chosen with " as... (2 Replies)
hi, can someone how to accept command line arguments as a variable using in script?
like: ./scriptname arguments
by accept arguments, I can use it in my script?
thx! (1 Reply)
I am new to the world of Unix and shell scripting and have been trying to get the following simple script to work:
#!/bin/bash
echo "what is your age?"
echo "you are $1 years old"I want to be able to enter my age on the command line, when prompted, and it return the... (1 Reply)
hi,,,,
I want to create a command prompt, for example "prompt>", so my prompt need to handle commands, for example "prompt>cmd", so i want to know how to get arguments for my own commands cmd, i.e. default argc should contain arguments count and argv should point to the argument vector i.e, for... (2 Replies)
Hi,
I've a python script called aaa.py and passing an command line option " -a" to the script like, ./aaa.py -a
& Inside the script if the -a option is given I do some operation if not something else.
code looks like
./aaa.py -a
.
.
if options.a
---some operation---
if not options.a... (1 Reply)
Hi all,
I am trying to write a code for addition of n numbers which will be passed by the user as command line arguments.
I wrote the following code.
add=0
for (( i = 1 ; i <= $# ; i++ ))
do
add=`expr $i + $add`
done
#echo "sum is : $add"
input :
$./add.sh 12 32 14... (7 Replies)
Discussion started by: PranavEcstasy
7 Replies
LEARN ABOUT DEBIAN
net::socks
Net::SOCKS(3pm) User Contributed Perl Documentation Net::SOCKS(3pm)NAME
Net::SOCKS - a SOCKS client class
SYNOPSIS
Establishing a connection:
my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',
socks_port => 1080,
user_id => 'the_user',
user_password => 'the_password',
force_nonanonymous => 1,
protocol_version => 5);
# connect to finger port and request finger information for some_user
my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79);
print $f "some_user
"; # example writing to socket
while (<$f>) { print } # example reading from socket
$sock->close();
Accepting an incoming connection:
my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',
socks_port => 1080,
user_id => 'the_user',
user_password => 'the_password',
force_nonanonymous => 1,
protocol_version => 5);
my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "128.10.10.11",
peer_port => 9999);
$f= $sock->accept();
print $f "Hi! Type something.
"; # example writing to socket
while (<$f>) { print } # example reading from socket
$sock->close();
DESCRIPTION
my $sock = new Net::SOCKS(socks_addr => '192.168.1.3',
socks_port => 1080,
user_id => 'the_user',
user_password => 'the_password',
force_nonanonymous => 1,
protocol_version => 5);
To connect to a SOCKS server, specify the SOCKS server's
hostname, port number, SOCKS protocol version, username, and
password. Username and password are optional if you plan
to use a SOCKS server that doesn't require any authentication.
If you would like to force the connection to be
nonanoymous, set the force_nonanonymous parameter.
my $f= $sock->connect(peer_addr => '192.168.1.3', peer_port => 79);
To connect to another machine using SOCKS, use the connect method.
Specify the host and port number as parameters.
my ($ip, $ip_dot_dec, $port) = $sock->bind(peer_addr => "192.168.1.3",
peer_port => 9999);
If you wanted to accept a connection with SOCKS, specify the host
and port of the machine you expect a connection from. Upon
success, bind() returns the ip address and port number that
the SOCKS server is listening at on your behalf.
$f= $sock->accept();
If a call to bind() returns a success status code SOCKS_OKAY,
a call to the accept() method will return when the peer host
connects to the host/port that was returned by the bind() method.
Upon success, accept() returns SOCKS_OKAY.
$sock->close();
Closes the connection.
SEE ALSO
RFC 1928, RFC 1929.
AUTHOR
Clinton Wong, clintdw@netcom.com
COPYRIGHT
Copyright (c) 1997-1998 Clinton Wong. 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.14.2 2012-04-18 Net::SOCKS(3pm)