Unknown error - ``' unmatched


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unknown error - ``' unmatched
# 1  
Old 08-30-2010
Unknown error - ``' unmatched

Hi Guys,

I get the error while running below commands. Earlier the command used to execute, but after enclosing them in a function, the error is occuring

Code:
backupPath=`echo $folderName | sed -e 's,/vobs/dte/itgClient/client/RegressionTestLibPostOHS/,,'`
check_event=`cat /sbt/driver/RegressionTests/ResultsArchive/$environment1/$backupPath/TestEvents.txt | grep "Test Cases FAIL"
| cut -c 18-`

# 2  
Old 08-30-2010
Maybe put a set -x outside and inside the function to see what value is assigned to the variables at runtime.
# 3  
Old 08-30-2010
try tu use $(...) in state of `...`
# 4  
Old 08-30-2010
hi
can you write your function code ?
# 5  
Old 08-31-2010
Thanks for your reply,

I replaced ('...') with $( ) , it worked.

Could you please mind explaining the reason for this.
Thanks
# 6  
Old 08-31-2010
The problem with the backquotes is that they can't be embedded ie:
Code:
A=$(echo "$(ls)"); echo "$A" # is OK
A=`echo "`ls`"`; echo "$A" # returns error

This User Gave Thanks to frans For This Post:
# 7  
Old 08-31-2010
They can be nested actually, but the inner backticks will need to be escaped...
Code:
A=`echo "\`ls\`"`; echo "$A"

which can make it difficult to understand. I much prefer the $() construct..
This User Gave Thanks to Scrutinizer For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting unknown operator error while using a function

Hi, I wrote a function for the first time and not able to get the desired result. I have requirement to execute 10 queries. For this i wrote a function like below. function Command { typeset var SOL; if ; then CONNECTION="${CONNECTION} -e -time"; else SOL="`nzsql ${CONNECTION} -c... (8 Replies)
Discussion started by: Samah
8 Replies

2. Shell Programming and Scripting

<< unmatched error

Hi all, I want to call a plsql package that does not return any value. I am using the following script to do so: sqlplus $UserNamePwd <<EOF set head off begin test_pkg.procedure('$DebugFlag'); end; exit EOF if then log_message "procedure failed." exit 1 fi exit $? I... (2 Replies)
Discussion started by: reshma15193
2 Replies

3. UNIX for Advanced & Expert Users

Using SFTP Error Server Unknown

Not sure if this is the right forum and I apologies if not. I use Expression web to update our website on a UNIX server using SFTP. I use the same laptop, software, that works fine when at home, but when I travel, I tend to get a unknown server error. I am suspecting that it has something to do... (2 Replies)
Discussion started by: ae3799t
2 Replies

4. Programming

Help Unknown Syntax Error

Please excuse me if this is an easy fix, for I am new to Unix and C '/problem1.c: line2: syntax error near unexpected token ` '/problem1.c: line2: `main() and for one program it has : command not found2: (above the syntax error) As mentioned this is in C not C++, I have complied all... (3 Replies)
Discussion started by: apolo93
3 Replies

5. Homework & Coursework Questions

FIFO possible blocking or unknown error

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a chat program using two FIFOs one for writing and the other for reading. The problem is something... (1 Reply)
Discussion started by: Ebodee
1 Replies

6. Shell Programming and Scripting

ksh vs ksh93 -- syntax error ... `(' unmatched.

x=$(cat <<EOF Hi. EOF) print "$x" If my shebang is "/bin/ksh" this print "Hi." If my shebang is /bin/ksh93 this errors with: syntax error at line 3: `(' unmatched. I guess my default ksh is ksh88. So, I'm used to setting variables this way, allowing a complex command (that may... (4 Replies)
Discussion started by: mattmiller
4 Replies

7. Shell Programming and Scripting

"else" unmatched error in shell script.

Friends I have pasted a script below d08083: cat tests #!/bin/ksh if then rm -r Last-Previous mv Previous Last-Previous mv Current Previous mkdir Current #cd Current mv $1 Current else cd Current mv "$1\$2" Current\*\ fi (4 Replies)
Discussion started by: Renjesh
4 Replies

8. Shell Programming and Scripting

Getting error "syntax error at line 78 : `<' unmatched"

Hi Guys, I have a following code in cm1.sh script. cnt=`sqlplus -s <un>/<pwd> << !EOF set heading off verify off pagesize 0 select count(*) from fnd_svc_components where component_name like '%Mailer%' and component_status != 'RUNNING'; exit; !EOF` echo $cnt if ; then sqlplus -s... (1 Reply)
Discussion started by: sshah1001
1 Replies

9. Solaris

Unknown File Type error

Greetings there, i was trying to install an eclipse plugin on sunOS 4.x for the solaris sparc platform, and i got the following error: /usr/project/RAServer/bin> ./RAStart.sh Starting Agent Controller ld.so.1: RAServer: fatal: /usr/project/RAServer/lib/libxerces-c.so.24: unknown file type... (3 Replies)
Discussion started by: rohitsz
3 Replies

10. Programming

Error: unknown pseudo-op: `.weakref'

It's really strange that I have these error messages as follows when I tried to compile the C++ program. g++ -c -pipe -DOpenModeType=std::_Ios_Openmode -g -I. -o Obj/NP_genome_info.o NP_genome_info.cpp {standard input}: Assembler messages: {standard input}:10: Error: unknown pseudo-op:... (6 Replies)
Discussion started by: napapanbkk
6 Replies
Login or Register to Ask a Question