Sponsored Content
Full Discussion: end of line error
Homework and Emergencies Homework & Coursework Questions end of line error Post 302707421 by Corona688 on Friday 28th of September 2012 02:09:32 PM
Old 09-28-2012
This looks sort of like a csh script, but if/then in sh doesn't work quite that way. It uses -eq, -ne, and so forth to compare numbers. =, != are used to compare strings.

There must be spaces between the brackets and whatever is inside -- and outside -- them. sh uses single square brackets, or double square brackets, not single round brackets.

You have to put a then after if.

You end the if-statement with fi, not endif.

You probably want less-than, rather than equal or not-equal, since it's possible for there to be one or more arguments, not just one. less-than is abbreviated into -lt.

Code:
if [ "$#" -lt 1 ]
then
        echo " Error No Parameters Passed"
        exit
fi

See Test Operators for what else you can do inside [ ] .
 

10 More Discussions You Might Find Interesting

1. Solaris

syntax error at line 59: `end of file' unexpected

Hello... I'm trying to run the sshd script, but I keep geting the Syntax errot message . Here's the last few lines on the script. set nu in vi shows 58 lines, but I keep getting error referring to line 59. Any help is appreciated. Thanks, Remi else echo... (4 Replies)
Discussion started by: Remi
4 Replies

2. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

3. Shell Programming and Scripting

a better way to grep until end of error message, although most seem to be 1 or 2 line

My file creates an output log after which includes a few sql queries. I segregate them into warnings and errors and then get a total count. The errors' and warnings' lines always start with SQL{4} followed by the details of the error. This is what im doing as o now... errors=`grep -A 1 -E... (11 Replies)
Discussion started by: VGR
11 Replies

4. Shell Programming and Scripting

mkmkfiles.imake: line 51: syntax error: unexpected end of file

Hi, i am installing glut-3.5 using that ./mkmkfiles.imake its showing an error msg as root@lxdevenv:~/Desktop/openGL/glut-3.5# ./mkmkfiles.imake ./mkmkfiles.imake: line 51: syntax error: unexpected end of file root@lxdevenv:~/Desktop/openGL/glut-3.5# actually there are 49 lines in... (3 Replies)
Discussion started by: Ravikishore
3 Replies

5. Shell Programming and Scripting

syntax error at line 752: `end of file' unexpected

Hi, I'm having a syntax error at line 752: `end of file' unexpected. However, i didn't make any changes on line 752. I just inserted a new code in an existing program. Can anyone please check if there is something wrong with my code: if then lline=`tail -5 $badfile` ... (3 Replies)
Discussion started by: chryz
3 Replies

6. Shell Programming and Scripting

./TRUNCATE-PS_TXN.sh: line 54: syntax error: unexpected end of file

Hi All , My below script is for chacking vaule and then trucating table : ___________ test4@aceuatcs04:/u01/test4/SOLID/Testscript>cat TRUNCATE-PS_TXN.sh #-------------------------------------------------------------------- # Created by:Kaushlesh Yadav # Generated on: 15/07/2010 # Job... (4 Replies)
Discussion started by: kaushelsh168
4 Replies

7. Shell Programming and Scripting

EOF Usage - line 56: syntax error: unexpected end of file

Below is a test script I'm writing in the process of learning to write script. When I try to run it I get an unexpected end of file error on line 56. Thoughts? SCRIPT: #!/bin/bash # system_page - A script to produce a system information HTML file ##### Constants TITLE="My System... (1 Reply)
Discussion started by: mpercy725
1 Replies

8. Shell Programming and Scripting

line 15: syntax error: unexpected end of file

Hi all, I am very new to programming and even newer to this forum as well, so I apologize if this should have been in the Newbie category, but... I am currently trying to figure out Shell Scripting and am running into problems early. Not having taken any kind of programming class, I am not even... (2 Replies)
Discussion started by: ccorder22
2 Replies

9. Red Hat

sh: module: line 1: syntax error: unexpected end of file

Hi, We have installed linux6(RHEL) OS and installed datastage application on that. First time installation worked fine and our all services related to datastage was up and running. When we stopped the datastage and restarted its giving below error while restart:- ./uv -admin -start DataStage... (0 Replies)
Discussion started by: prasson_ibm
0 Replies

10. Shell Programming and Scripting

Del: line 13: syntax error: unexpected end of file

1 echo -e "Enter a filename" 2 read filename 3 if 4 then 5 echo -e "do you want to delete?" 6 read answer 7 if 8 then rm myfirst 9 else 10 echo -e "file not deleted" 11 fi 12 exit0 (1 Reply)
Discussion started by: Speedy
1 Replies
NOWEB(1)						      General Commands Manual							  NOWEB(1)

NAME
noweb - a simple literate-programming tool SYNOPSIS
noweb [-t] [-o] [-Lformat] [-markup parser] [file] ... DESCRIPTION
Noweb is a literate-programming tool like FunnelWEB or nuweb, only simpler. A noweb file contains program source code interleaved with documentation. When noweb is invoked, it writes the program source code to the output files mentioned in the noweb file, and it writes a TeX file for typeset documentation. The noweb(1) command is for people who don't like reading man pages or who are switching from nuweb. To get the most out of noweb, use notangle(1) and noweave(1) instead. FORMAT OF NOWEB FILES
A noweb file is a sequence of chunks, which may appear in any order. A chunk may contain code or documentation. Documentation chunks begin with a line that starts with an at sign (@) followed by a space or newline. They have no names. Code chunks begin with <<chunk name>>= on a line by itself. The double left angle bracket (<<) must be in the first column. Chunks are terminated by the beginning of another chunk, or by end of file. If the first line in the file does not mark the beginning of a chunk, it is assumed to be the first line of a documentation chunk. Documentation chunks contain text that is copied verbatim to the TeX file (except for quoted code). noweb works with LaTeX; the first doc- umentation chunk must contain a LaTeX documentclass command, it must contain usepackage{noweb} in the preamble, and finally it must also contain a LaTeX egin{document} command. Code chunks contain program source code and references to other code chunks. Several code chunks may have the same name; noweb concate- nates their definitions to produce a single chunk, just as other literate-programming tools do. noweb looks for chunks that are defined but not used in the source file. If the name of such a chunk contains no spaces, the chunk is an ``output file;'' noweb expands it and writes the result onto the file of the same name. A code-chunk definition is like a macro definition; it contains references to other chunks, which are themselves expanded, and so on. noweb's output is readable; it preserves the indentation of expanded chunks with respect to the chunks in which they appear. If a star (*) is appended to the name of an output file, noweb includes line-number information as specified by the -Lformat option (or for C if no -Lformat option is given). The name itself may not contain shell metacharacters. Code may be quoted within documentation chunks by placing double square brackets ([[...]]) around it. These double square brackets are used to give the code special typographic treatment in the TeX file. If quoted code ends with three or more square brackets, noweb chooses the rightmost pair, so that, for example, [[a[i]]] is parsed correctly. In code, noweb treats unpaired double left or right angle brackets as literal << and >>. To force any such brackets, even paired brackets or brackets in documentation, to be treated as literal, use a preceding at sign (e.g. @<<). OPTIONS
-t Suppress generation of a TeX file. -o Suppress generation of output files. -Lformat Use format to format line-number information for starred output files. (If the option is omitted, a format suitable for C is used.) format is as defined by notangle(1); -markup parser Use parser to parse the input file. Enables use of noweb tools on files in other formats; for example, the numarkup parser under- stands nuweb(1) format. See nowebfilters(7) for more information. For experts only. BUGS
Ignoring unused chunks whose names contain spaces sometimes causes problems, especially in the case when a chunk has multiple definitions and one is misspelled; the misspelled definition will be silently ignored. noroots(1) can be used as a sanity checker to catch this sort of mistake. noweb is intended for users who don't want the power or the complexity of command-line options. More sophisticated users should avoid noweb and use noweave and notangle instead. If the design were better, we could all use the same commands. noweb requires the new version of awk. DEC nawk has a bug in that that causes problems with braces in TeX output. GNU gawk is reported to work. The default LaTeX pagestyles don't set the width of the boxes containing headers and footers. Since noweb code paragraphs are extra wide, this LaTeX bug sometimes results in extra-wide headers and footers. The remedy is to redefine the relevant ps@* commands; ps@noweb in noweb.sty can be used as an example. SEE ALSO
notangle(1), noweave(1), noroots(1), nountangle(1), nowebstyle(7), nowebfilters(7), nuweb2noweb(1) Norman Ramsey, Literate programming simplified, IEEE Software 11(5):97-105, September 1994. VERSION
This man page is from noweb version 2.11b. AUTHOR
Norman Ramsey, Harvard University. Internet address nr@eecs.harvard.edu. Noweb home page at http://www.eecs.harvard.edu/~nr/noweb. local 3/28/2001 NOWEB(1)
All times are GMT -4. The time now is 09:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy