Hi,
I want to send input to promt from shell script, this thing is possible.
I give the one command
`/usr/share/ssl/misc/CA -newreq`
it needs some user input like password etc., but i need this input also from shell script but it does not works.
`/usr/share/ssl/misc/CA -newreq` <<EOF... (2 Replies)
Hi,
I have a perl script which prints me the epoch value of a specific date and time given.Now I want to proceed to a next step ie i want to give the input at the time of execution.
I have to initialise the date and time values in the script before executing it.But now i want to give the date... (3 Replies)
how to wrote a script that reads an input from the reader (dir name) and then answer yes to all questions in the script unless the answer to any of the questions contains a certain string?
example:
$] script.sh dir_name
$] question_1: (answer should be y right after the question is echoed,... (3 Replies)
Hi
I am stucked in the below script .I want to input with yes/no from the user and then execute the code inside if but it is not working .I just need the logic as where I am wrong so that i can use the same in my work .
then
echo "Hi All"
fi
].
Please suugest . (4 Replies)
hi experts
Question in perl
i'm creating a script to take from user a different inputs one of them is the carriage return .. so that i want to make an if condition if the user hit enter key the user will go to previous step
it something like that
chomp ($input = <STDIN>);
if ($input =~... (3 Replies)
Hi
I have a file like so:
Code:
Frank Peter Tony Robert Mike 1 2 3 4 5 5 4 2 3 1 4 3 1 5 2
My out should look like this:
Peter
Tony
Mike
and so on....
I have the first part done to ask the user to... (8 Replies)
have three big data file, however I just need to see the mentioned below one line form the all the file which has SERVER_CONNECTION Value
File 1
export SERVER_CONNECTION=//dvlna002:10001/SmartServer
File2
export SERVER_CONNECTION=///SmartServer
File3
export... (1 Reply)
Is the below correct syntax for if the user enters something other than "GJB2 or MECP2, or PHOX2B", then they are shown on the screen format.txt and allowed to enter in one of those formats? Thank you :).
Basically, the user can see which formats are allowed and enter a variant while viewing... (7 Replies)
Hi ,
when i am logging to the server i need to give input of specific key like k or l or m etc. and then need to put enter. need to use this in script . please assist. (1 Reply)
Hi,
This is a script which to create an opvn user, I want which answer automatically to a certain part so, I try this, it works without the red part but I must type manually.. :
#!/bin/bash
## Environnement ##
LC_ALL=C
## Paths ##
rsa_dir="etc/openvpn/easy-rsa"... (10 Replies)
Discussion started by: Arnaudh78
10 Replies
LEARN ABOUT FREEBSD
upscli_get
UPSCLI_GET(3) NUT Manual UPSCLI_GET(3)NAME
upscli_get - retrieve data from a UPS
SYNOPSIS
#include <upsclient.h>
int upscli_get(UPSCONN_t *ups, int numq, const char **query,
int *numa, char ***answer)
DESCRIPTION
The upscli_get() function takes the pointer ups to a UPSCONN_t state structure, and the pointer query to an array of numq query elements.
It builds a properly-formatted request from those elements and transmits it to upsd(8).
Upon success, the response will be split into separate components. A pointer to those components will be returned in answer. The number of
usable answer components will be returned in numa.
USES
This function implements the "GET" command in the protocol. As a result, you can use it to request many different things from the server.
Some examples are:
o GET NUMLOGINS <ups>
o GET UPSDESC <ups>
o GET VAR <ups> <var>
o GET TYPE <ups> <var>
o GET DESC <ups> <var>
o GET CMDDESC <ups> <cmd>
QUERY FORMATTING
To generate a request for GET NUMLOGINS su700, you would populate query and numq as follows:
int numq;
const char *query[2];
query[0] = "NUMLOGINS";
query[1] = "su700";
numq = 2;
All escaping of special characters and quoting of elements with spaces is handled for you inside this function.
ANSWER FORMATTING
The raw response from upsd to the above query would be NUMLOGINS su700 1. Since this is split up for you, the values work out like this:
numa = 3;
answer[0] = "NUMLOGINS"
answer[1] = "su700"
answer[2] = "1"
Notice that the value which you seek typically starts at answer[numq].
ERROR CHECKING
This function will check your query against the response from upsd(8). For example, if you send "VAR" "su700" "ups.status", it will expect
to see those at the beginning of the response.
If the results from upsd do not pass this case-insensitive test against your request, this function will return an error. When this
happens, upscli_upserror(3) will return UPSCLI_ERR_PROTOCOL.
ANSWER ARRAY LIFETIME
The pointers contained within the answer array are only valid until the next call to a upsclient function which references them. If you
need to use data from multiple calls, you must copy it somewhere else first.
The answer array and its elements may change locations, so you must not rely on previous addresses. You must only use the addresses which
were returned by the most recent call. You also must not attempt to use more than numa elements in answer. Such behavior is undefined, and
may yield bogus data or a crash.
The array will be deleted after calling upscli_disconnect(3). Any access after that point is also undefined.
RETURN VALUE
The upscli_get() function returns 0 on success, or -1 if an error occurs.
SEE ALSO upscli_list_start(3), upscli_list_next(3), upscli_strerror(3), upscli_upserror(3)Network UPS Tools 05/22/2012 UPSCLI_GET(3)