![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Double quotes or single quotes when using ssh? | password636 | Shell Programming and Scripting | 3 | 05-29-2008 09:52 PM |
| awk to print ' (single quotes) | orahi001 | UNIX for Dummies Questions & Answers | 2 | 03-11-2008 04:30 PM |
| echo using single quotes | chella | Shell Programming and Scripting | 3 | 10-29-2007 12:54 AM |
| Checking Single Quotes in C | janemary.a | High Level Programming | 3 | 06-07-2007 03:48 AM |
| im stuck! 'single quotes' | satnamx | UNIX for Dummies Questions & Answers | 4 | 03-29-2006 07:44 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Filename containing Single Quotes
Hi ,
I am passing a variable site_name from a shellscript to an SQL script and then I want to spool an sql query on to my Unix box and generate a CSV file. Everything works fine but I have to give quotes to the variable '&&site_name' in spool statement ..if i remove the quotes it generates an LST file or some other type of file.I am working on korn shell .. pls help me remove the single quotes from my filename..I have tried many options but unable to resolve it... define site_name=&&1 spool /projects/hpsd_dwh/global_extract/Closed_Case_Extract/MTD/'&&site_name'.csv thanks in advance ... cheers!! |
|
||||
|
Can you tell us what do you want to from
define site_name=&&1 spool /projects/hpsd_dwh/global_extract/Closed_Case_Extract/MTD/'&&site_name'.csv? It is good to give exact requirement to guide a solution to you? |
|
||||
|
Hi Muthu,
I am sorry abt it. this is my sql script.. --------------------------------- define site_name=&&1 spool /projects/hpsd_dwh/global_extract/Closed_Case_Extract/MTD/'&&site_name'.csv select * from mytable; spool off; exit; ---------------------------------- using the spool statement I want to generate a CSV file. But now the problem is the file which is getting generated has single quotes. Which I don't want...and if I remove the quotes .... CSV file is not getting generated.. I want a filename('&&sitename') without quotes....And the value for &&sitename is coming from a shell script... Hope its clear..thnks a lot |
|
||||
|
After creating CSV file quote using spool then rename that file with quote on shell??
We can remove ' as, echo /projects/hpsd_dwh/global_extract/Closed_Case_Extract/MTD/'&&site_name'.csv | tr -d "'" /projects/hpsd_dwh/global_extract/Closed_Case_Extract/MTD/&&site_name.csv I hope it is ok. If i am wrong then give problem in this. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|