Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Can not determine end-of-file error Post 302991800 by V1l1h1 on Thursday 16th of February 2017 11:07:22 AM
Old 02-16-2017
for "indentation" sake I've used spaces..
is that the issue?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

End of file unexpected error

Hi, I am new to unix. I have written a script whenever i am giving sh filename.sh its prompting unexpected end of file in line number 40 in that line i have echo statement what do i need to do thanks in advance (5 Replies)
Discussion started by: hamsa
5 Replies

2. Shell Programming and Scripting

unexpected end of file error

hi, i am trying to connect to sqlplus in an 'if block' from the script. it is giving unexpected end of file error. and it works fine if it is out of 'if block'. if anybody have idea on this, can you please help me to solve the error ? piece of code is given below. if then... (11 Replies)
Discussion started by: vinayakatj56
11 Replies

3. Shell Programming and Scripting

unexpected end of file error

When I run the following script: #! /bin/bash for var in CA CC CD CT EC PC do cat << EOF > ${var}_full.dat echo T ${var}_high echo C age echo C sex echo C ht echo C WT_lg EOF cat << EOF > ${var}_agesex.dat ... (4 Replies)
Discussion started by: polly_falconer
4 Replies

4. Shell Programming and Scripting

syntax error: unexpected end of file

Hi, I have problem in constructing "IF" condition. The below code throws "tst.sh: line 10: syntax error: unexpected end of file" #!/bin/ksh test=9 echo $test if ] then echo "in" fi echo "end" exit 0 Actually, i want to check whether the variable $test is empty or null. ... (5 Replies)
Discussion started by: tinku
5 Replies

5. Shell Programming and Scripting

syntax error: unexpected end of file

Hi, I am newbie to UNIX scripting. I am facing this error "syntax error: unexpected end of file" while executing the following script: ------ a=$1 if then sqlplus -s prospect_stg/prospect_stg@mdmpt <<END insert into bckup_marc_parameter_lookup select * from... (6 Replies)
Discussion started by: boopathyvasagam
6 Replies

6. Shell Programming and Scripting

error unexpected end of file

Sometimes while unziping some files i got an error and the further unziping stopped.might be other files are able to be unzip.i.e gunzip a.Z b.Z c.Z gunzip: a.Z: unexpected end of file it found an error on a.Z and stopped but b.Z and C.Z might be correct. why this error comes and is... (2 Replies)
Discussion started by: malikshahid85
2 Replies

7. Shell Programming and Scripting

`end of file' unexpected error

When I am executing my really simple shell script below, I got an error: `end of file' unexpected. Script is suppose to print out a list of supplied parameters. Here is my script: #!/bin/sh a=$# #number or parameters b=0 #starting counter while do b=`expr $b + 1` echo... (9 Replies)
Discussion started by: alexstar
9 Replies

8. Shell Programming and Scripting

Unexpected end of file error

Hi , I am new to Unix and this is my first shell script . I am facing "unexpected end of file error" while executing my code . tried removing blank spaces Unable to trace out the error . PLease help !!! #!/bin/sh echo hello if ] echo hi then var=`cat liq_table_nm.txt` ... (6 Replies)
Discussion started by: sen180185
6 Replies

9. Shell Programming and Scripting

Unexpected End Of File Error

Hi guys, I am new to BASH scripting and I was wondering if anyone could have a look at this code and explain to me why I am getting an Unexpected End of File Error ? If you can that would be great / much appreciated! THANKS! #!/bin/bash USER="" PASS="" if ; then echo "You need to set... (1 Reply)
Discussion started by: spooke
1 Replies

10. Shell Programming and Scripting

IF section problem. syntax error: unexpected end of file error

Hello, I have another problem with my script. Please accept my apologies, but I am really nooby in sh scripts. I am writing it for first time. My script: returned=`tail -50 SapLogs.log | grep -i "Error"` echo $returned if ; then echo "There is no errors in the logs" fi And after... (10 Replies)
Discussion started by: jedzio
10 Replies
Text::FindIndent(3pm)					User Contributed Perl Documentation				     Text::FindIndent(3pm)

NAME
Text::FindIndent - Heuristically determine the indent style SYNOPSIS
use Text::FindIndent; my $indentation_type = Text::FindIndent->parse($text, skip_pod => 1); if ($indentation_type =~ /^s(d+)/) { print "Indentation with $1 spaces "; } elsif ($indentation_type =~ /^t(d+)/) { print "Indentation with tabs, a tab should indent by $1 characters "; } elsif ($indentation_type =~ /^m(d+)/) { print "Indentation with $1 characters in tab/space mixed mode "; } else { print "Indentation style unknown "; } DESCRIPTION
This is a module that attempts to intuit the underlying indent "policy" for a text file (most likely a source code file). METHODS
parse The class method "parse" tries to determine the indentation style of the given piece of text (which must start at a new line and can be passed in either as a string or as a reference to a scalar containing the string). Returns a letter followed by a number. If the letter is "s", then the text is most likely indented with spaces. The number indicates the number of spaces used for indentation. A "t" indicates tabs. The number after the "t" indicates the number characters each level of indentation corresponds to. A "u" indicates that the indenation style could not be determined. Finally, an "m" followed by a number means that this many characters are used for each indentation level, but the indentation is an arbitrary number of tabs followed by 0-7 spaces. This can happen if your editor is stupid enough to do smart indentation/whitespace compression. (I.e. replaces all indentations many tabs as possible but leaves the rest as spaces.) The function supports parsing of "vim" modelines. Those settings override the heuristics. The modeline's options that are recognized are "sts"/"softtabstob", "et"/"noet"/"expandtabs"/"noexpandtabs", and "ts"/"tabstop". Similarly, parsing of "emacs" Local Variables is somewhat supported. "parse" use explicit settings to override the heuristics but uses style settings only as a fallback. The following options are recognized: "tab-width", "indent-tabs-mode", "c-basic-offset", and "style". There is one named option that you can pass to "parse()": "skip_pod". When set to true, any section of POD (see perlpod) will be ignored for indentation finding. This is because verbatim paragraphs and examples embedded in POD or quite often indented differently from normal Perl code around the POD section. Defaults to false. Example: my $mode = Text::FindIndent->parse($text, skip_pod => 1); to_vim_commands A class method that converts the output of "parse($text)" into a series of vi(m) commands that will configure vim to use the detected indentation setting. Returns zero (failure) or more lines of text that are suitable for passing to "VIM::DoCommand()" one by one. As a convenience, if the argument to "to_vim_commands" doesn't look like the output of "parse", it is redirected to "parse" first. To use this, you can put the following line in your .vimrc if your vim has Perl support. Suggestions on how to do this in a more elegant way are welcome. The code should be on one line but is broken up for displaying: map <F5> <Esc> :perl use Text::FindIndent;VIM::DoCommand($_) for Text::FindIndent->to_vim_commands(join " ", $curbuf->Get(1..$curbuf->Count()));<CR> (Patches to implement the equivalent for emacs would be welcome as well.) SUPPORT
Bugs should be reported via the CPAN bug tracker at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-FindIndent> For other issues, contact the author. AUTHOR
Steffen Mueller <smueller@cpan.org> Adam Kennedy <adamk@cpan.org> COPYRIGHT
Copyright 2008 - 2010 Steffen Mueller. Copyright 2008 - 2010 Adam Kennedy, This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.10.1 2011-01-04 Text::FindIndent(3pm)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy