|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
Unexpected EOF while looking for matching `"'
Hi everyone, I am trying to search for a string in a file that is partly made up of a variable. Here's the code: Code:
echo "parentCategory = $parentCategory" echo "parentCategoryFormatted = $parentCategoryFormatted" numUrlsFoundInParentCategory=`grep -c "<Topic r:id=\"Top\/World\/Français\/" $inputFile` echo "Hard-coded result = $numUrlsFoundInParentCategory" numUrlsFoundInParentCategory=`grep -c \""<Topic r:id=\\\"$parentCategoryFormatted"\" $inputFile` echo grep -c \""<Topic r:id=\\\"$parentCategoryFormatted"\" $inputFile echo "Dynamic result = $numUrlsFoundInParentCategory" It produces the output... parentCategory = Top/World/Français/ parentCategoryFormatted = Top\/World\/Français\/ Hard-coded result = 22093 ./dmozStats.sh: command substitution: line 44: unexpected EOF while looking for matching `"' ./dmozStats.sh: command substitution: line 45: syntax error: unexpected end of file grep -c "<Topic r:id=\"Top\/World\/Français\/" content.rdf.u8.clean Dynamic result = I can't find out why the command using the variable won't work when it appears to look the same as the hard-coded version. Thanks! |
| Sponsored Links |
|
|
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error to "find" a matching array element in a directory | mkbaral | Shell Programming and Scripting | 1 | 09-30-2008 02:06 PM |
| "syntax error near unexpected token `fi' " | GIC1986 | Solaris | 4 | 09-19-2008 01:17 PM |
| "unexpected end of file" when I´m use EOF inside block if | ricardo.ludwig | Shell Programming and Scripting | 4 | 03-28-2008 03:45 PM |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 11:16 AM |
| "syntax error at line 21 :'done' unexpected." error message" | ibroxy | Shell Programming and Scripting | 3 | 08-08-2007 07:45 AM |