![]() |
|
|
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 |
| If Statement Problem.. | LinuxRacr | Shell Programming and Scripting | 2 | 02-27-2008 12:47 AM |
| problem with if statement equality | cleansing_flame | Shell Programming and Scripting | 1 | 02-12-2008 10:57 AM |
| if statement problem | djt0506 | UNIX for Dummies Questions & Answers | 4 | 12-04-2005 08:16 PM |
| problem with an IF statement | hcclnoodles | Shell Programming and Scripting | 2 | 04-17-2003 11:53 AM |
| if statement problem | coughlin74 | UNIX for Dummies Questions & Answers | 1 | 09-27-2001 05:31 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Creating an sql statement from a file. Problem with '
Hi, I am trying to create sql statements from a file, but I have a problem with ':
This is what I do: cat filex.txt | awk -F: '{print $1,"A","and personnavn like",$5}' | sed -e "s/^/select bruker.brukernavn, person.personnavn from bruker, person where brukernavn like '/" -e "s/$/' and bruker.person=person.id;/" The output from this is: select bruker.brukernavn, person.personnavn from bruker, person where brukernavn like 'xxx A and personnavn like XX XXXX' and bruker.person=person.id; What I would like to have is: select bruker.brukernavn, person.personnavn from bruker, person where brukernavn like 'xxx' and personnavn like 'XX XXXX' and bruker.person=person.id; I am trying something like this: cat filex.txt | awk -F: '{print $1,"\' and personnavn like \'",$5}' | sed -e "s/^/select bruker.brukernavn, person.personnavn from bruker, person where brukernavn like '/" -e "s/$/' and bruker.person=person.id;/" But no .... |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|