Home > Syntax Error > Unix Syntax Error Unmatched

Unix Syntax Error Unmatched

Contents

What object can prove the equations? Brgds, Sangal_ak04 (India). * 1st line inside tdlconf.sh is: #!/bin/ksh * $ type ksh ksh is /bin/ksh * After running the script by using: $ ksh -vx ./tdlconf.sh > tdlconf.out-test system Perhaps, the script sms.ksh should be shared and you should clean the script and use output from either grep, awk, nawk, cut. Does Nietzsche's rejection of Socrates mean that he is a relativist about ethics? have a peek here

if I remove the #!/xxx line the script is executed and returns:# /home/vanadm/iftest/home/vanadm/iftest: Syntax error at line 1 : `if' is not matched.I am root, all files are rwxrwxrwx, and /usr/bin/sh I see in my ksh93 man page: If # is appended to <<, then leading spaces and tabs will be stripped off the first line of the document and up to One main difference is that the last pipe command runs as a separate shell !!!!!! Good eyes, thanks for your help! http://stackoverflow.com/questions/22441311/shell-script-unmatched-syntax-error-using-here-document

Unmatched Error In Shell Script

Oh, and my workplace gave me a $2 keyboard that skips f c and g whenever it wants my special attention. ls, cut, echo, etc. (00.000001%, i.e. However, I work hard to write portable scripts. And vi causes problems with my telnet client (CRT for Win) - so I used a Win-Editor with built-in ftp-client.Well at least I am now aware of the problem - strange

WHENEVER SQLERROR exit ROLLBACK set SQLPROMPT '' set heading off set pagesize 1000 set linesize 5000 set feedback off set define on set verify off @smm9_stream_map.sql $STREAM_NAME $FIELD_NAME" exit !!`; a=`expr It's not always so obvious what it's for and again, can be messed up by someone later maintaining the code. It is not clear where the first for loop should terminate, but the syntax is incomplete. `for' Unmatched Not a member yet?

One of my seniors told me that on our current Linux box, we are using pdksh (instead of ksh, that we were using on SunOS earlier). Chris Wolf replied May 16, 2013 Yes, I just noticed that, thank you. RE: '<<' unmatched Error feherke (Programmer) 23 Sep 08 03:46 HiQuote (SamBones):feherke's suggestion of adding the dash ("<<-!") is the best because then it doesn't matter if you have leading spaces http://www.unix.com/shell-programming-and-scripting/36201-unmatched-ksh-script-using-sftp.html Why cast an A-lister for Groot?

That would make it look like...CODE#!/usr/bin/ksh############################################################instance.ksh #############################################################DBALIST="[email protected], [email protected]";export DBALISTORATAB=/var/opt/oracle/oratabecho "`date` "echo"Oracle Database(s) Status `hostname` :\n"db=`egrep -i ":Y|:N" $ORATAB | cut -d":" -f1 | grep -v "\#" | grep -v "\*"`for i If Unmatched Error In Unix Shell Script My program thus far is #!/usr/bin/ksh message="" when="" validFiles="" validUsers="" if [ $# -gt 0 ] ; then while getopts w:m: opt do case $opt in w) when=$OPTARG;; m) message=$OPTARG;; \?) various environment variables set here ... asked 2 years ago viewed 5539 times active 2 years ago Related 2151Check if a directory exists in a shell script1shell script to get the file name from a string0Shell script

  1. In fact you could have as many blank lines as you want.feherke's suggestion of adding the dash ("<<-!") is the best because then it doesn't matter if you have leading spaces
  2. Cool !
  3. Make a copy of the script and begin taking lines out until you don't get the mis-match error.
  4. Cool !

Unmatched Error In Unix

But recently, we have shifted to Linux Red hat box and on this box, this script is showing an error mesg. Join your peers on the Internet's largest technical computer professional community.It's easy to join and it's free. Unmatched Error In Shell Script cheers, drl Welcome - get the most out of the forum by reading forum basics and guidelines: click here. 90% of questions can be answered by using man pages, Quick Search, Syntax Error At Line If' Unmatched Honour has been the reward for what he gave (clavin coolidge) 0 Kudos Reply Christian Vollmar Occasional Visitor Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email

RE: '<<' unmatched Error feherke (Programmer) 21 Sep 08 10:22 HiOr add a dash ( - ) and make sure you use tabs for indenting :CODE --> mkshsqlplus -L "/as sysdba" navigate here I also declared some variables outside all the functions at the top of the script...and now everything is working fine. Browse other questions tagged shell sqlplus ksh or ask your own question. We look forward to helping you with the challenge of the other 10%. ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP ) Reply `newline' Unmatched

You may need to replace some commands with assignments of constant strings to variables, but you'll be able to isolate the problem soon or later. I tried the if [ xxx ] and the if test xxx syntax with no differenceI tried using multiple lines as above and a one-liner (if ; then ; else ; When I run the code as below the script exits with a message saying ./my_script.sh: line 53: syntax error at line 61: `<<' unmatched I've used set -x and can see Check This Out Any helps!!

exit !! ) (*) the exception being, for heredocs using <<-, any leading tabs will be stripped from the heredoc, including from the terminator. Syntax Error 'while' Unmatched Sometimes you can start from the original script, sometimes not. Thx much!

the changes below in the script ======== old script code.... (was working fine on SunOS with KSH shell) but not on Linux OS in ksh or Bash giving '{' unmatched error

How about a numeric test?export TEST=1if (( $TEST == 1 ))then print "test is one"else print "test not one"fiI would be tempted to look at environment variables and the shell you more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation And you should be aware this is an Oracle forum and not a Unix one. `then' Unmatched In Unix Top Best Answer 0 Mark this reply as the best answer?(Choose carefully, this can't be changed) Yes | No Saving...

All product names are trademarks of their respective companies. Join Us! *Tek-Tips's functionality depends on members receiving e-mail. What does OGR stand for? this contact form Die Liebe höret nimmer auf How to fix a bent lens mount hook?

very lightweight low power microcontroller with memory? asked 2 years ago viewed 5199 times active 2 years ago Related 0arithmetic syntax error in ksh if condition1arithmetic syntax error in shell script0comparing two array in ksh script0what is -a Register. 08-10-2006 #1 Sangal-Arun View Profile View Forum Posts Private Message View Articles Linux Newbie Join Date May 2006 Location Gurgaon, India + Denver Colorado USA Posts 101 Ksh script error The function I have pasted earlier was giving error because while pinging the values in the variables were "" (Emtpy) and this was coming because child shells variables are not passed

We look forward to helping you with the challenge of the other 10%. ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP ) Reply Where can I download one of those from ? 1 Kudo Reply Yogeeraj_1 Honored Contributor [Founder] Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email to a will make the HERE document fail. quote ok_status=`echo $conc_request' Just a guess.

Whoo! Give it a try. HTH,p5wizard Red Flag This Post Please let us know here why this post is inappropriate. almost never) Best wishes ...

Then run: Code: ksh -vx s1 that will show you step-by-step what is happening. Indeed I edited the files on an PC and transferred them to the HP - this worked fine for all the etc/*s and other config files I had to edit during What I found is that the value inside ${ipaddr} variable is "UNKNOWN" (default value set inside the script to this variable), and somehow system is not taking the actual IP address. Always use the '-' afterthe << and before the first CONTENT tag Eg:- cat <<-CONTENT resolved CONTENT Description cat(space)<<-CONTENT(no-space)(no-characters) (space)(space)(space)(space)resolved(space)(space)(space)(any-characters) (no-characters)(no-space)CONTENT(no-space)(no-characters) Result follows; resolved Last edited by shabeer; 08-28-2008 at 10:07

To start viewing messages, select the forum that you want to visit from the selection below. ** If you are logged in, most ads will not be displayed. ** Linuxforums now By using this site, you accept the Terms of Use and Rules of Participation. End of content United StatesHewlett Packard Enterprise International CorporateCorporateAccessibilityCareersContact UsCorporate ResponsibilityEventsHewlett Packard LabsInvestor RelationsLeadershipNewsroomSitemapPartnersPartnersFind a PartnerPartner PCMag Digital Group AdChoices unused Register Help Remember Me? Chris Wolf replied May 16, 2013 I was going to ask about that very same thing.