Sponsored Content
Top Forums Shell Programming and Scripting Passing global variable to a function which is called by another function Post 302210243 by vgersh99 on Monday 30th of June 2008 11:39:15 AM
Old 06-30-2008
Quote:
Originally Posted by alby
how do i get a result in fraction in shell script.

I am using expr for division of two numbers but it is giving Quotient.

I need it in full fraction value.
Pls don't 'piggy-back' threads - start a new thread.
Also please read the Rules.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing a variable name to be created within a function

Is it possible to pass a variable name, as a parameter to a function, so it can be created within this function ? Something like this: func_uppercase abcdefgh var_name where the 1st parameter is the string I want to convert and the 2nd is the desired variable name... $2=`echo "$1" |... (2 Replies)
Discussion started by: 435 Gavea
2 Replies

2. UNIX for Dummies Questions & Answers

passing variable to function

Hi, I am trying to sum up numbered columns and in order to tidy up the program I have wrote a function to do the adding of some numbers. I have a problem though with passing a variable to the function in the UNIX bash shell. The function only gives the first number in the variable list and does... (4 Replies)
Discussion started by: Knotty
4 Replies

3. UNIX for Advanced & Expert Users

Passing a unix variable value to a Plsql function

Suppose I have a unix variable called RGNM which is holding a value. Now I want to call a plsql function in my script. THis plsql function takes one IN parameter. I want to pass my UNIX VARIABLE Value to the plsql function. Can i just give it by giving $RGNM in the function after calling sqlplus... (1 Reply)
Discussion started by: cobroraj
1 Replies

4. UNIX for Dummies Questions & Answers

passing a variable inside a variable to a function

I would like to know how to pass a variable inside a variable to a function. sample code below -------------- for x in 1 9 do check_null $C$x ##call function to check if the value is null if then echo "line number:$var_cnt,... (2 Replies)
Discussion started by: KingVikram
2 Replies

5. Shell Programming and Scripting

Return a value from called function to the calling function

I have two scripts. script1.sh looks -------------------------------- #!/bin/bash display() { echo "Welcome to Unix" } display ----------------------------- Script2.sh #!/bin/bash sh script1.sh //simply calling script1.sh ------------------------------ (1 Reply)
Discussion started by: mvictorvijayan
1 Replies

6. Shell Programming and Scripting

passing variable content to a function

following on from below link https://www.unix.com/shell-programming-scripting/171076-shell-scripting.html#post302573569 i will be using file reading in while loop say for example while read line123 do echo "line read is $line123" insert_funct $line123 done< mysqldump.sql... (6 Replies)
Discussion started by: vivek d r
6 Replies

7. Shell Programming and Scripting

Error during Accessing Global variable inside function

emailid=myemail@xyz.com taskName="DB-Backup" starttime=`date` email() { subject="$taskName" ": " $* " at `date` " mutt -s "$subject" $emailid < /dev/null } email "Starting" #do my stuff email "Finished" The above code gives following error ./dbbackup.sh: line 6: :... (5 Replies)
Discussion started by: nitiraj.rathore
5 Replies

8. Shell Programming and Scripting

Passing variable value in a function to be used by another function

Hello All, I would like to ask help from you on how to pass variable value from a function that has been called inside the function. I have created below and put the variables in " ". Is there another way I can do this? Thank you in advance. readtasklist() { while read -r mod ver... (1 Reply)
Discussion started by: aderamos12
1 Replies

9. Shell Programming and Scripting

Function getting called recursively

I have the below script which creates a directory or simply terminates without throwing error (exit 1) incase the directory exists. bash-4.1$ vi mdir.sh #!/bin/bash -e shopt -s expand_aliases alias mkdir=mkdir_s mkdir_s(){ if ]; then echo " directory EXISTS " return else echo "... (3 Replies)
Discussion started by: mohtashims
3 Replies

10. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
http(n) 							 Tnm Tcl Extension							   http(n)

__________________________________________________________________________________________________________________________________________________

NAME
http - Send and process HTTP requests. _________________________________________________________________ DESCRIPTION
The Hypertext Transfer Protocol (HTTP) (RFC 1945) is a client/server protocol used to retrieve documents in the World Wide Web. Documents are addressed using Uniform Resource Locators (URL) (RFC 1738). The http command allows to implement HTTP clients and a simple HTTP server. HTTP COMMAND
The following list of http commands is useful for HTTP clients: http proxy [url] The http proxy command allows to define a proxy HTTP server which will be used in subsequent client commands. Using this command without an url argument will return the URL to the currently used proxy or an empty string. Providing a url argument sets the proxy server. Setting the proxy to an empty string turns the proxy feature off. http head url The http head command retrieves the HTTP header for the document located at url. The header is returned as a list of keys and values which can be converted into a Tcl array using the array set command. http get url fileName The http get command retrieves the document located at url. The body of the document is written to the file named fileName. The com- mand returns the HTTP header as described for the http head command above. http post url docFileName fileName The http post command posts the document in docFileName to the location url. The body of the returned document is written to the file named fileName. The command returns the HTTP header as described for the http head command above. http put url docFileName The http put command puts the document in docFileName to the location url. The command returns the HTTP header as described for the http head command above. http delete url The http delete command deletes the document at the location defined by url. The command returns HTTP status information. The following set of http commands is useful for a simple HTTP server: http server [port] The http server command starts a simple HTTP server listening on port port. If called without a port argument, the currently used port number or an empty string is returned. An empty string indicates that no server is currently active. http mime type extension The http mime command is used to add mime type definitions to the internal table which maps file name extension to mime types. If called without an argument, the list of all mime type mappings is returned. A new mapping is created by supplying a mime type and the file name extension. http bind pattern method [script] The http bind command binds a Tcl script to the invocation of a HTTP method where the URL matches pattern. Whenever a HTTP request of type method is received that matches the pattern, script is evaluated. The return value of the script must be a name of a file which will be send back to the client. Errors during the evaluation of the script will result in an error response. The following % sequences are substituted before a script bound to a URL is evaluated: %A The network address of the client. %P The URL path requested by the client. %S The search path contained in the URL path. SEE ALSO
scotty(1), Tnm(n), Tcl(n) AUTHORS
Juergen Schoenwaelder <schoenw@cs.utwente.nl> Tnm http(n)
All times are GMT -4. The time now is 07:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy