?
Solved

Unix shell syntax error

Posted on 2006-07-07
4
Medium Priority
?
2,808 Views
Last Modified: 2013-12-26
Hi all,

I'm quite new to UNIX shell scripting and need some explanation of an error I'm getting. I've got quite a good grasp of vbScript within Windows but I can't see what's wrong here.

This is the error message: -

script.sh[51]: syntax error at line 68 : `"' unmatched

Here's te section of the script in question: -

ll $RunColDir/*CITI*
if [ $? != 0 ]
        then echo " There are no files to process in $RunPayDir " # this is line 68
       exit 5
fi

If anyone has any good web site resources for learning UNIX shell programming can you let me know.

Thanks in advance.
0
Comment
Question by:mass2612
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 17057386
there is most likel an unmatchd " before line 68
0
 
LVL 29

Author Comment

by:mass2612
ID: 17057730
Thanks ahoffmann. You were on the money. Would you recommend any sites or books for learning to script via the shell in more detail? I've got a good understanding of basic command and would like to know more.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17059512
there're too much books about that, best you're going to a book store and compare some of them
IIRC there is one from Edison-Wesley simply named Unix Shells which covers the common ones.
0
 
LVL 1

Expert Comment

by:tacticalvehicle
ID: 17060492
When I trie identify you problem
I have to say somethink

on UNIx is many shells each have some futures and dis-advatages
some unix shell are  small and fast but with very sesitive on  on scipting syntax

budg  can be earlier than this but bad quotation or semicolon also missing somewhere
that's my intro
----------------------------------------
now back to your problem from data which you provide,,..

$ cat test.sh

#!/bin/bash
# also ksh should working I know problem with sh-posix or ash
ls -la .                                                           # your command
if [ $? -eq 0 ]; then                                         # -eq isnt same as = man ksh  ( value and string )
   echo "ll cmd working fine";                           # if is $? = 0 everythink is fine
else
   echo " There are no files to process in ";       # if is $? not equal 0 - ohmm... Houston we have poroblem...
-----------------------------------------------------------------------------------------------------------------------------------
executed my script
$test.sh

total 4
drwxr-xr-x 2 tactical  None   0 Jul  7 19:31 .
drwxr-xr-x 7 tactical  None   0 Jan  1  1970 ..
-rw-r--r-- 1  tactical   None 113 Jul  7 19:34 test.sh
ll cmd working fine

$ echo $SHELL
/bin/bash


0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question