Sponsored Content
Top Forums Shell Programming and Scripting passing variable content to a function Post 302574723 by vivek d r on Friday 18th of November 2011 07:15:28 AM
Old 11-18-2011
like the below
Code:
`reserved2` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`reserved3` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`server` text COLLATE utf8_unicode_ci NOT NULL,

there are many columns.. so how can i extract only column name from this.. column name changes everytime and differs it specification
consider the above 1st or 2nd or 3rd line will be in a variable called var i want to extract only reserved2 or reserved3 or server to a variable. can you plz help me how to do that.. :-/

---------- Post updated at 05:45 PM ---------- Previous update was at 05:44 PM ----------

i am getting this error... :-/ if you go through the code in the hyper link you might be able to understand

Code:
this line not present : `reserved6` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
sending these: Active and also `reserved6` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'echo "dollar 1: Active"
        echo "dollar 2: `reserved6` varchar(255) COLLATE utf8_u' at line 1
Script  failed please verify the sqls

 

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

Passing global variable to a function which is called by another function

Hi , I have three funcions f1, f2 and f3 . f1 calls f2 and f2 calls f3 . I have a global variable "period" which i want to pass to f3 . Can i pass the variable directly in the definition of f3 ? Pls help . sars (4 Replies)
Discussion started by: sars
4 Replies

6. Shell Programming and Scripting

Passing the parameters using a function

Hi All, I am new to shell scripting required some help in passing the parameter value to the shell script. I am writing a shell script, in the script I have created two functions as below. first function get_trend_ids () { Here I am connecting to the database and getting all the... (3 Replies)
Discussion started by: shruthidwh
3 Replies

7. Shell Programming and Scripting

Passing file content as parameter

Hi All, I am passing a file value as parameter to awk command; Par.txt A|B Input.txt A,1 B,3 C,4 D,5 My desired output should be A,1 B,3 (4 Replies)
Discussion started by: kmsekhar
4 Replies

8. Programming

PASSING PART OF FILE CONTENT TO VARIABLE

All, I have a log file containing lots of data now i want to extract all text between block below(names) without the title or end pattern but only names, ++++START++++ SCOTT TIGER HENRY PAUL JARED OTIENO OMOLLO JA NIGERIA ++++END++++ the names i want to return and store in a variable in... (1 Reply)
Discussion started by: Scott2000
1 Replies

9. UNIX for Advanced & Expert Users

Passing variable as input & storing output in other variable

I have a below syntax its working fine... var12=$(ps -ef | grep apache | awk '{print $2,$4}') Im getting expected output as below: printf "%b\n" "${VAR12}" dell 123 dell 456 dell 457 Now I wrote a while loop.. the output of VAR12 should be passed as input parameters to while loop and results... (5 Replies)
Discussion started by: sam@sam
5 Replies

10. 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
HTML::Mason::Escapes(3pm)				User Contributed Perl Documentation				 HTML::Mason::Escapes(3pm)

NAME
HTML::Mason::Escapes - Functions to escape text for Mason DESCRIPTION
This module contains functions for implementing Mason's substitution escaping feature. These functions may also be called directly. html_entities_escape This function takes a scalar reference and HTML-escapes it using the "HTML::Entities" module. By default, this module assumes that the string it is escaping is in ISO-8859-1 (pre Perl 5.8.0) or UTF-8 (Perl 5.8.0 onwards). If this is not the case for your data, you will want to override this escape to do the right thing for your encoding. See the section on User-defined Escapes in the Developer's Manual for more details on how to do this. url_escape This takes a scalar reference and replaces any text it contains matching "[^a-zA-Z0-9_.-]" with the URL-escaped equivalent, a percent sign (%) followed by the hexadecimal number of that character. basic_html_escape This function takes a scalar reference and HTML-escapes it, escaping the following characters: '&', '>', '<', and '"'. It is provided for those who wish to use it to replace (or supplement) the existing 'h' escape flag, via the Interpreter's "set_escape()" method. This function is provided in order to allow people to return the HTML escaping behavior in 1.0x. However, this behavior presents a potential security risk of allowing cross-site scripting attacks. HTML escaping should always be done based on the character set a page is in. Merely escaping the four characters mentioned above is not sufficient. The quick summary of why is that for some character sets, characters other than '<' may be interpreted as a "less than" sign, meaning that just filtering '<' and '>' will not stop all cross-site scripting attacks. See http://www.megasecurity.org/Info/cross-site_scripting.txt for more details. perl v5.14.2 2012-02-04 HTML::Mason::Escapes(3pm)
All times are GMT -4. The time now is 02:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy