Hi all!
I need a little help with an imbedded fuction I am trying to write. What I am trying to do is go to a series of hosts and get the contents of an XML file, storing some of the data, along with the name of the host it was gathered from. My intent is to store this in an array for later... (1 Reply)
Hi,
I would like to use a power function in Bash in an awk '{ } .
e.g pow(2,3)=8
Any suggestion? I try to find online resources but most of them stated by using BC.
Please advise. Thanks. (3 Replies)
I want to have a function with a similar interface:
search *.cpp asdf
that will search recursively all directories for *.cpp file, containing line 'asdf' inside. I tried this:
function search { find . -name "$1" | xargs grep -li $2; }
But it doesn't work all the time. For example, if i run it... (3 Replies)
Hello all,
I would like to know if it is possible to return a the result of a boolean expression from a function like this
function()
{
# some code
return ||
}
and what will be the return value ?
Thank you for help. (6 Replies)
My script-
result=""
times()
{
echo "inside the times function"
result=8
echo "Inside function $result"
return $result
}
result=$(times)
echo "the value is "$?
echo "the value of result $result"
when I run I get this, why the value still remain 0.
$ ./func
the value is 0
the value... (5 Replies)
Hey everyone.
I am currently testing my first function based BASH script. The ultimate goal is going to be moving logs from point A to point B (or if B is down, to point C).
Part of this involves the following function:
function testAlive{
ping -c 1 -q $1
}
Now when I run ping -c... (1 Reply)
I need to add a selection within the bash function below and am having some trouble doing so.
phox2b() {
printf "\n\n"
printf "What is the id of the patient getting Phox2B analysis : "; read id
printf "Is this an intronic variant? Y/N "; read match_choice
case... (5 Replies)
I am putting this thread to shell-threads, because it is about how to make a function work properly. I need a hint for declaring a function right, it has been more than a year I did not work that straight with bash.
So my aim is to turn off the eth0 (as it would be in linux, and bge0 in bsd ),... (2 Replies)
I am trying to figure out why I am having a "problem" with some functions in a bash script I am running. The reason for air quoting is that the functions are working, they are just not displaying anything to screen when called from another function. Here's an example:
function Create_Input
{... (6 Replies)
Discussion started by: dagamier
6 Replies
LEARN ABOUT CENTOS
ne_set_connect_timeout
NE_SET_USERAGENT(3) neon API reference NE_SET_USERAGENT(3)NAME
ne_set_useragent, ne_set_read_timeout, ne_set_connect_timeout, ne_get_scheme, ne_get_server_hostport - common properties for HTTP sessions
SYNOPSIS
#include <ne_session.h>
void ne_set_useragent(ne_session *session, const char *product);
void ne_set_read_timeout(ne_session *session, int timeout);
void ne_set_connect_timeout(ne_session *session, int timeout);
const char *ne_get_scheme(ne_sesssion *session);
const char *ne_get_server_hostport(ne_sesssion *session);
DESCRIPTION
The User-Agent request header is used to identify the software which generated the request for statistical or debugging purposes. neon does
not send a User-Agent header unless a call is made to the ne_set_useragent. ne_set_useragent must be passed a product string conforming to
RFC2616's product token grammar; of the form "Product/Version".
When neon reads from a socket, by default the read operation will time out after 60 seconds, and the request will fail giving an NE_TIMEOUT
error. To configure this timeout interval, call ne_set_read_timeout giving the desired number of seconds as the timeout parameter.
When a connection is being established to a server, normally only the system's TCP timeout handling will apply. To configure a specific
(and probably shorter) timeout, the ne_set_connect_timeout can be used, giving the desired number of seconds as the timeout parameter. If 0
is passed, then the default behaviour of using the system TCP timeout will be used.
The scheme used to initially create the session will be returned by ne_get_scheme.
The hostport pair with which the session is associated will be returned by the ne_get_server_hostport; for example www.example.com:8080.
Note that the :port will be omitted if the default port for the scheme is used.
EXAMPLES
Set a user-agent string:
ne_session *sess = ne_session_create(...);
ne_set_useragent(sess, "MyApplication/2.1");
Set a 30 second read timeout:
ne_session *sess = ne_session_create(...);
ne_set_read_timeout(sess, 30);
SEE ALSO
ne_session_create, ne_set_session_flag.
AUTHOR
Joe Orton <neon@lists.manyfish.co.uk>
Author.
COPYRIGHT neon 0.30.0 31 July 2013 NE_SET_USERAGENT(3)