unix - passing a string variables into a function ksh -


I am trying to pass string variables inside the function (bteq works by itself), but not receiving it Could work to do I try:

  td_instance = "one" user = "usr1" pass = "pass1" skimman = "schema a" tblName = "tableA" query = "SEL '& gt; $ (*) To $ schema. $ Tbl name "query_td () {bteq .LOGON $ td_instance / $ user, $ pass $ $ schema name; .set width 1000; .set surcharges off; $ 1; .Log off; .QUIT; .EXIT} echo $ (query_td  

And continue this error:

  -ksh:.: Syntax error: `) 'unexpected  

I walked around a lot of compenents But still can not seem to do it. I keep the same error when I move things up, do not be sure what is wrong here, but I know something. ...

------ --- UPDATE ------------

THEN THINK Based on the comments given ... I have tried to simplify it so that it can be easier to debug it ... I 'have now got the function to do this ...

  Query_td () {bteq "$ (cat $ HOME / .tdlogon) database $ skimmanam; .set width 1000 ;; .EXIT "} query_td $ query  

but now it starts running

  bteq" $ (cat $ home / .tdlogon)  < / Pre> 

But for some reason nothing is run before that part of the function. It launches the bteq program and logs in, but then just waiting for the command sits in Bettek ...

Here's how I was able to work it ... Eof went inside the statement ... I think this is what you were talking about, are not you?

  td_query () {bteq & lt; & Lt; EOF | Grape '^ & gt;' | Sed -e "s / s ^" $ "$ (Cat $ Home / .tdlogon) Database $ schema name; .set width 1000; .set surcharges off; $ 1 .LOGOFF; .QUIT; .EXIT EOF} "date is:" $ (TD_coreia "SEL"> Current_data; '))  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -