Home > Syntax Error > Unmatched Error In Shell Script

Unmatched Error In Shell Script

Contents

Assume your script is on a file called s1. If you later edit the script with an editor which expands tabs to sequence of spaces, your code will be messed. ( Additionally, as a personal opinion, indenting with tabs is Join UsClose current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to customize your list. Brgds, Arun Sangal Brgds, ARUN SANGAL SCM: 1- 720 251 9962 Email: [email protected] Email: [email protected] Reply With Quote 09-10-2006 #7 drl View Profile View Forum Posts Private Message View Articles Linux http://fullflash.net/syntax-error/syntax-error-unexpected-in-shell-script.html

Ksh error issue '{' unmatched Thanks- Drl / skiboy. 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 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. 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 http://stackoverflow.com/questions/22441311/shell-script-unmatched-syntax-error-using-here-document

Unmatched Error In Shell Script

The specific code your referenced looks good enough.Craig 0 Kudos Reply Christian Vollmar Occasional Visitor Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email to a Friend I agree that you should consider making this run as a bash script. I usually indent my code so it's easier to spot those things For Do For Do Commands... Why do we need blockchains? 2011 MacBook Pro upgrade?

  1. 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
  2. Register now while it's still free!
  3. Join Us! *Tek-Tips's functionality depends on members receiving e-mail.
  4. Registration on or use of this site constitutes acceptance of our Privacy Policy.
  5. What was the first operating system to feature a separate kernel?
  6. What does this ice key do?
  7. Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... learn unix and linux commands "<< Unmatched" in ksh script
  8. HTH,p5wizard RE: '<<' unmatched Error Annihilannic (MIS) 3 Oct 08 02:53 Granted, but nothing that :%s//^I/g won't fix.I couldn't live without >} and <} for in/undent paragraph when coding/scripting.What wouldyou do
  9. I have four instances on the server.
  10. Any helps will be highly apprecaited.

Paul_Pedant replied May 16, 2013 You have two "do" but only one "done". the same script seems to work for me.I've attached it. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. `for' Unmatched It was tabbed over to emphasize the loop.

I also started using the code block delimiters using dots to hold the indents and blank lines open. Unmatched Error In Unix It wasn't the spaces around the <<, but the space in front of the the second EOF. drives me crazy. useful source Error mesg: (1) /home/sparc/bin/tdlconf [[email protected]] $ ./tdlconf.sh > tdlconf.out-test ./tdlconf.sh[54]: syntax error: `{' unmatched Code snap from the script: ------------------------- .. ... 54 function get_osrel { 55 56 /usr/sbin/ping ${ipaddr} >

Whitespace is any one of a number of characters that you can't see, like a blank or space (" "), or a tab character. If Unmatched Error In Unix Shell Script Strange device identification Lengthwise or widthwise. I've been hunting for an explanation on and off all day to no avail. –BriteSponge Mar 20 '15 at 16:20 add a comment| Your Answer draft saved draft discarded Sign Start a new thread here 5196839 Related Discussions grep for errors Syntax Error : 'bad suffix on number' Compact df without an intermediary temp file Problem With Print Command Unix Shell

Unmatched Error In Unix

HTH,p5wizard Red Flag This Post Please let us know here why this post is inappropriate. http://www.tek-tips.com/viewthread.cfm?qid=1501773 Split python tuple in subtuples with capacity limit in functional programming style Can the editor of a book add citations of individual chapters to his own citation count? Unmatched Error In Shell Script By joining you are opting in to receive e-mail. Syntax Error At Line If' Unmatched If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pat- tern

its giving me error . this content It didn't mean you couldn't have blank lines. ls, cut, echo, etc. (00.000001%, i.e. Exclamation marks are special characters in many circumstances and are prone to be misinterpreted. 3) and probably more relevant to your question, the terminator must not be indented. `newline' Unmatched

Quote:ok_status="echo $conc_request" [Updated on: Thu, 21 February 2008 14:30]Report message to a moderator Re: Error message ' ' ' unmatched [message #301797 is a reply to message #301795] Thu, But recently, we have shifted to Linux Red hat box and on this box, this script is showing an error mesg. If parameter is an array variable subscripted with @ or *, the pattern removal operation is applied to each member of the array in turn, and the expansion is the resultant http://fullflash.net/syntax-error/syntax-error-unexpected-end-of-file-shell-script.html Anyone have any ideas?

more stuff ... Syntax Error 'while' Unmatched opinion . It was flaky acouple of years ago, and I gave up using it, but it might be worth another look now.

given below at line 54.

What are the German equivalents of “First World War”, “World War I”, and “WWI”? Feherke.http://rootshell.be/~feherke/ RE: '<<' unmatched Error tekpr00 (IS/IT--Management) (OP) 21 Sep 08 12:37 tahnks for your suggestions everyone. The zeroth suggestion is to make sure you copied the script correctly and that it is using ksh, not bash (in Linux if you say sh you get bash) -- if `then' Unmatched In Unix One main difference is that the last pipe command runs as a separate shell !!!!!!

Why cast an A-lister for Groot? The problem I am facing is that, when I run this script on SunOS, then system executes this script just perfectly and creates an output file. Why was Susan treated so unkindly? check over here 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

RE: '<<' unmatched Error SamBones (Programmer) 22 Sep 08 13:23 Quote:Note, I just used the grep -v ^$ file.in > file.out to remove the white space as sugested in the previouse SXA Page Design vs Page Standard Values vs Page Branch Template "Full-time Employment is a Loophole in the Law to Make Wages Lower"? If you ran on Solaris, you were probably using the real Korn shell. 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

osrel0="ski(1)" echo "Original :$osrel0:" echo osrel1=${osrel0%(*} echo "After pattern :$osrel1:" Which results in: Code: % ./s1 Original :ski(1): After pattern :ski: This is described in man bash as noted below ... Just in case...my 2 cents-- Rod Hills There be dragons... 1 Kudo Reply Tom Geudens Honored Contributor [Founder] Options Mark as New Bookmark Subscribe Subscribe to RSS Feed Highlight Print Email 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