Sponsored Content
Full Discussion: Bash INKEY$ function...
Top Forums UNIX for Dummies Questions & Answers Bash INKEY$ function... Post 302785605 by wisecracker on Tuesday 26th of March 2013 03:46:29 AM
Old 03-26-2013
Hi Corona688...

Thanks for the info...
One day I will become a coder... ;o)

I have used a derivative of it in the next stage of the AudioScope as a pseudo vertical shift control, so I thought I would let other people like me have it...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need assistance with bash function

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)
Discussion started by: _jade_
1 Replies

2. Shell Programming and Scripting

Need help in using power function in Bash

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)
Discussion started by: ahjiefreak
3 Replies

3. Shell Programming and Scripting

bash search function

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)
Discussion started by: doze
3 Replies

4. Shell Programming and Scripting

[Bash]Function returning a boolean

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)
Discussion started by: dolphin06
6 Replies

5. Shell Programming and Scripting

In bash getting weird output from function ?

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)
Discussion started by: boy18nj
5 Replies

6. Shell Programming and Scripting

BASH function error

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)
Discussion started by: msarro
1 Replies

7. Shell Programming and Scripting

Bash function

startvm() { startguest } Is there a way use one line to get this ? actually I want startvm=startguest (5 Replies)
Discussion started by: yanglei_fage
5 Replies

8. Shell Programming and Scripting

Yes or No selection within bash function

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)
Discussion started by: cmccabe
5 Replies

9. Shell Programming and Scripting

Bash function, for BSD

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)
Discussion started by: 1in10
2 Replies

10. Shell Programming and Scripting

Bash function problem

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
Frontier::RPC2(3pm)					User Contributed Perl Documentation				       Frontier::RPC2(3pm)

NAME
Frontier::RPC2 - encode/decode RPC2 format XML SYNOPSIS
use Frontier::RPC2; $coder = Frontier::RPC2->new; $xml_string = $coder->encode_call($method, @args); $xml_string = $coder->encode_response($result); $xml_string = $coder->encode_fault($code, $message); $call = $coder->decode($xml_string); $response_xml = $coder->serve($request_xml, $methods); $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); DESCRIPTION
Frontier::RPC2 encodes and decodes XML RPC calls. $coder = Frontier::RPC2->new( OPTIONS ) Create a new encoder/decoder. The following option is supported: encoding The XML encoding to be specified in the XML declaration of encoded RPC requests or responses. Decoded results may have a different encoding specified; XML::Parser will convert decoded data to UTF-8. The default encoding is none, which uses XML 1.0's default of UTF-8. For example: $server = Frontier::RPC2->new( 'encoding' => 'ISO-8859-1' ); use_objects If set to a non-zero value will convert incoming <i4>, <float>, and <string> values to objects instead of scalars. See int(), float(), and string() below for more details. $xml_string = $coder->encode_call($method, @args) `"encode_call"' converts a method name and it's arguments into an RPC2 `"methodCall"' element, returning the XML fragment. $xml_string = $coder->encode_response($result) `"encode_response"' converts the return value of a procedure into an RPC2 `"methodResponse"' element containing the result, returning the XML fragment. $xml_string = $coder->encode_fault($code, $message) `"encode_fault"' converts a fault code and message into an RPC2 `"methodResponse"' element containing a `"fault"' element, returning the XML fragment. $call = $coder->decode($xml_string) `"decode"' converts an XML string containing an RPC2 `"methodCall"' or `"methodResponse"' element into a hash containing three members, `"type"', `"value"', and `"method_name"'. `"type"' is one of `"call"', `"response"', or `"fault"'. `"value"' is array containing the parameters or result of the RPC. For a `"call"' type, `"value"' contains call's parameters and `"method_name"' contains the method being called. For a `"response"' type, the `"value"' array contains call's result. For a `"fault"' type, the `"value"' array contains a hash with the two members `"faultCode"' and `"faultMessage"'. $response_xml = $coder->serve($request_xml, $methods) `"serve"' decodes `$request_xml', looks up the called method name in the `$methods' hash and calls it, and then encodes and returns the response as XML. $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); These methods create and return XML-RPC-specific datatypes that can be passed to the encoder. The decoder may also return these datatypes. The corresponding package names (for use with `"ref()"', for example) are `"Frontier::RPC2::Boolean"', `"Frontier::RPC2::DateTime::ISO8601"', and `"Frontier::RPC2::Base64"'. You can change and retrieve the value of boolean, date/time, and base64 data using the `"value"' method of those objects, i.e.: $boolean = $boolean_object->value; $boolean_object->value(1); Note: `"base64()"' does not encode or decode base64 data for you, you must use MIME::Base64 or similar module for that. $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); By default, you may pass ordinary Perl values (scalars) to be encoded. RPC2 automatically converts them to XML-RPC types if they look like an integer, float, or as a string. This assumption causes problems when you want to pass a string that looks like "0096", RPC2 will convert that to an <i4> because it looks like an integer. With these methods, you could now create a string object like this: $part_num = $coder->string("0096"); and be confident that it will be passed as an XML-RPC string. You can change and retrieve values from objects using value() as described above. SEE ALSO
perl(1), Frontier::Daemon(3), Frontier::Client(3) <http://www.scripting.com/frontier5/xml/code/rpc.html> AUTHOR
Ken MacLeod <ken@bitsko.slc.ut.us> perl v5.10.1 2011-04-05 Frontier::RPC2(3pm)
All times are GMT -4. The time now is 02:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy