All Rights Reserved. share|improve this answer answered Sep 3 '13 at 8:42 Frantique 5,4661637 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign I did not get a syntax error. tail -50 SapAdapterInboundRfc-P30-SapAdapterInboundSynchronous.log | grep -i "Error" >/dev/null then echo "There is no error in the last 50 lines in the logfile" fi The Following User Says Thank read the full info here
The time now is 10:48 PM. more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed You seem to be looking for date +%T -d 'now + 10 seconds'. Run the file ("./tmp.sh") with no arguments 6.
Find More Posts by ilikejam 04-29-2010, 12:30 PM #6 catkin LQ 5k Club Registered: Dec 2008 Location: Tamil Nadu, India Distribution: Debian Posts: 8,576 Blog Entries: 31 Rep: The To get that error message from bash for the command: set -xv, you must be using an editor that uses the DOS convention of carriage-return followed by newline as the line It is very strange that the output from the 1st script you showed us did not contain the line: Code: === Checking logs === Please add the following line to your Syntax Error Near Unexpected Token `fi' Also the usual convention in shell scripts is to put a newline after then and else.
syntax error: unexpected end of file error Hello, I have another problem with my script. Why were Navajo code talkers used during WW2? First, let me say there is nothing wrong with line 3. http://unix.stackexchange.com/questions/114138/shell-unexpected-end-of-file-error How do we play with irregular attendance?
In lightning component, are only html items responsive at all? Delimited By End-of-file (wanted `eof') PSM Last edited by paulsm4; 04-29-2010 at 04:55 PM. Is giving my girlfriend money for her mortgage closing costs and down payment considered fraud? Strange device identification SXA Page Design vs Page Standard Values vs Page Branch Template How would a person see with an adjustable cross-shaped pupil?
Solutions? http://linuxcommand.org/wss0100.php Magic Item Distribution? Syntax Error Unexpected End Of File Bash I should have asked what editor you were using! Syntax Error Unexpected End Of Input How to select citizen justices?
Here is what it looks like: [[email protected] me]$ ./trouble.bash + number=1 + '[' 1 = 1 ']' + echo 'Number equals 1' Number equals 1 Alternately, you can use the set his comment is here The single bracket construct is an ordinary built-in command, so special characters such as < retain their normal meaning. deadeyes View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by deadeyes 04-29-2010, 11:03 AM #3 catkin LQ 5k Club Registered: Dec 2008 How to fix a bent lens mount hook? Shell Script Validator
I have simplified my code majorly and still get the same error so there's obviously something wrong with my basic syntax. #usr/bin/sh if [$1 -lt $2]; then echo "done" else echo shell shell-script share|improve this question asked Feb 8 '14 at 2:31 Ramesh 16.1k1676124 1 What are the machines? Find all posts by Corona688
Extraneous carriage returns in shell scripts, source code for other languages, and in data files will cause you no end of grief.
very lightweight low power microcontroller with memory? Why does my capsule collider fall without my object (Unity)? To the shell, this looks like three assignments that apply to the command fi. navigate here This site is not affiliated with Linus Torvalds or The Open Group in any way.
You should simply if nc -z $Host $Port What you're doing is comparing the variable $result_nc ('nc -z $Host $Port; echo $?') with 0, which will never be true. –moebius_eye Jun This brings up an important thing to remember when you are writing your scripts. Use echo commands to verify your assumptions.