I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in.
How can I make the function receive the whole string (and not terminate at the first space it encounters)?.
part of the script I am executing
$strExtractQuery="select TRAN_I from TRAN with UR"
echo "SQL to be validated: " ${strExtractQuery}
sql_validate ${strExtractQuery}
function sql_validate # Accepts 1 parameter
{
Sqltext=$1
echo "In sql validate " : ${Sqltext}
}
Output
SQL to be validated: select TRAN_I from TRAN with UR
In sql validate 1 : select
Any help?
Thanks