String Error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting String Error
# 1  
Old 04-15-2008
String Error

WHile executing a script i am getting the error - " Unterminated String". Exact display of error is as below:

awk: /BOS_TITLE/ { printf("%s", " Back Office System
awk: ^ unterminated string


What is the reason for the error and its solution?
# 2  
Old 04-15-2008
It means you miss a closing quote.
# 3  
Old 04-15-2008
I had written the complete statement, still it gave the same error. Thestatement that i wrote is as below:
awk '/BOS_TITLE/ { printf("%s", "'"$bos_title"'")}'
# 4  
Old 04-15-2008
Try this:

Code:
awk '/BOS_TITLE/ { printf("%s", '"$bos_title"')}'

or:

Code:
awk -v var="$bos_title" '/BOS_TITLE/ { printf("%s", var )}'

Regards
# 5  
Old 04-15-2008
Hi Franklin52,
the 2nd one is working..thank you so much
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AWK error - string cannot be longer than X bytes

Hi Friends, Could you please tell me why i am getting the below eror while working with awk. I am confused :confused: what to do ? awk: 0602-591 String 1,9,20,6,6 cannot be longer than 399 bytes. The source line is 1. The error context is >>> <<< awk: 0602-591... (2 Replies)
Discussion started by: i150371485
2 Replies

2. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

3. Programming

Error with the string.h header

I get this error when I try to compile following C program #include <stdio.h> #include <strings.h> #define LEN 80 int main(void) { int mess, flag = 1; int first = 0, last = 0; printf("Enter a message: "); gets(mess); if (strlen(mess) > LEN) ... (3 Replies)
Discussion started by: solaris_user
3 Replies

4. Shell Programming and Scripting

python - string encoding error

I'm trying to pull a google calendar (successful) and then put the contents into a mysql db (almost successful). On one of the field I keep getting an encode error: #!/usr/bin/python from xml.etree import ElementTree import gdata.calendar.data import gdata.calendar.client import... (12 Replies)
Discussion started by: unclecameron
12 Replies

5. Shell Programming and Scripting

Error in if condition string comparison

Hello all! I need help in debugging following script. I have no idea where I am going wrong. #!/bin/bash for p1 in A1 TM MP do for p2 in A1 TM MP do for mp1 in N1 N2 do for mp2 in N1 N2 do for mp3 in N1 N2 do for mp4 in N1 N2 do for... (7 Replies)
Discussion started by: RLOA
7 Replies

6. Shell Programming and Scripting

Syntax error: Unterminated quoted string

I keep having problems when exicuting this file. It always gives me the error message "36: Syntax error: Unterminated quoted string" If someone could help me edit this it would be much appreciated. #!/bin/sh # # This will continue adding numbers # untill the total is greater than 1,000 #... (5 Replies)
Discussion started by: evilSerph
5 Replies

7. Solaris

Error in String comparison

Hi, I am getting an error while executing the below code. The error is " then echo "string matches" fi Please help me to solve this error (3 Replies)
Discussion started by: sreedivia
3 Replies

8. Shell Programming and Scripting

RE error 41: No remembered search string.

I found when i run this code #! /bin/ksh error_log="/tmp/log3.txt" while read line ; do show=`grep "$line" $error_log|tail -1` case $line in "Finished") msg="VOLUME_MGR_ERROR" echo $line ... (1 Reply)
Discussion started by: unitipon
1 Replies

9. Shell Programming and Scripting

String replace perl script error

I have written down a simple perl program to replace a string from a word file. My script does'nt seem to work. Any pointers to make it work will be appreciated. The code is given below. #!/usr/bin/perl while (<>) { open(FILE,$_); while (<FILE>) { s/This/I did it/g; }... (6 Replies)
Discussion started by: MobileUser
6 Replies
Login or Register to Ask a Question