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
Solved

Unix shell syntax error

Posted on 2006-07-07
4
2,804 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
  • 2
4 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 500 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 148
Whole sheet autoscrub still needed 19 51
substring method in java 1 129
maven archtype selection in eclipse 1 57
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.

792 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