Home > Parse Error > Parse Error In Shell Script

Parse Error In Shell Script

Contents

I suppose the newer version assumes %f to begin with. Problem to left align within a split Where's the 0xBEEF? Glad to help out. Bash Guru Registered: Jun 2004 Location: Osaka, Japan Distribution: Debian sid + kde 3.5 & 4.4 Posts: 6,823 Rep: And here's a bash version that follows the same logic as Source

Bash Guru Registered: Jun 2004 Location: Osaka, Japan Distribution: Debian sid + kde 3.5 & 4.4 Posts: 6,823 Rep: Don't worry about inexperience. Thread Tools Show Printable Version Email this Page Search this Thread Advanced Search Posting Rules You may not post new threads You may not post replies You may not post attachments It's quick & easy. (standard_in) 1: parse error P: 7 hta1984 Expand|Select|Wrap|Line Numbers #!/bin/bash #sar.sh i=1 whilereadmyline do if[$i-eq1] then echo"ReportDate:$(cut-d""-f4ornek2-c.txt)">output.txt elif[$i-gt3] then echo$myline>temp.txt proc=$(cut-d""-f3temp.txt) echo$proc>temp.txt cattemp.txt>>temp2.txt fi i=$(expr$i+1) done

(standard_in) 2: Parse Error

Upper bounds for regulators of real quadratic fields Would there be no time in a universe with only light? Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ Also, bash has a (( )) variant that doesn't require working with expansion. Last edited by David the H.; 10-04-2011 at 07:08 AM.

Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Does "when ~ dies, deal n damage to all players/creatures" have a name? Notation for lengths What does 'tirar los tejos' mean? This site is not affiliated with Linus Torvalds or The Open Group in any way.

Password Home Search Forums Register Forum RulesMan PagesUnix Commands Linux Commands FAQ Members Today's Posts Shell Programming and Scripting BSD, Linux, and Unix shell scripting Post awk, bash, csh, ksh, (standard_in) 1 Syntax Error Bc David the H. How to improve this plot? nishant.ny View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by nishant.ny 10-02-2011, 11:00 AM #9 David the H.

Hence i am constantly setting and then unsetting the variable value. Why do jet engines smoke? Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the Generating Pythagorean triples below an upper bound Upper bounds for regulators of real quadratic fields How do I "Install" Linux?

(standard_in) 1 Syntax Error Bc

thanks a ton. https://bytes.com/topic/unix/answers/576717-standard_in-1-parse-error the line Code: y2=`sed -n "${i}p" test_file | awk '{print $2}'` y1=`sed -n "${j}p" test_file | awk '{print $2}'` x2=`sed -n "${i}p" test_file | awk '{print $1}'` x1=`sed -n "${j}p" test_file (standard_in) 2: Parse Error They are automatically interpreted as variables and expanded. Browse other questions tagged linux bash shell or ask your own question.

Terms Privacy Security Status Help You can't perform that action at this time. this contact form The best way to cure it is listen when the experts point out your mistakes. share|improve this answer answered Jun 8 '12 at 1:39 sarnold 77.1k12114162 That definitely did it. Not the answer you're looking for?

When you get a chance, read through this guide. The time now is 06:45 PM. You should try $(...) for command substitution. have a peek here Click Here to receive this Complete Guide absolutely free.

If you're experiencing a problem with the output of sed, then your problem probably lies somewhere else. Should I boost his character level to match the rest of the group? Note that your shell can do integer math easily, but floating point numbers must be handled by an external tool like bc, dc, or awk.

UNIX is a registered trademark of The Open Group.

So spacing out the echo also works.) Bullseye.... Registration is quick, simple and absolutely free. Each hour, the script should execute, parse the previous hour's logs, and the already alerted or listed errors should not repeat. Browse other questions tagged bash bc or ask your own question.

that shortens it a bit \m/ Quote: Code: y2=$( awk -v line="$i" 'NR == line { print $2 }' test_file ) & Code: iline=$( sed -n "${i}p" test_file ) jline=$( sed Unix & Linux Forums > Top Forums > Shell Programming and Scripting Member Name Remember Me? One of the true gurus will probably be along presently to show you how. 2 members found this post helpful. Check This Out You can try: CACHE=$(free -m | more | grep -v Swap | tail -1 | cut -d':' -f2 | awk '{print $1}') NOTE Use awk to parse output is better than

You are currently viewing LQ as a guest. The question does not have to be directly related to Linux and any language is fair game. There are lots of unneeded calls to external programs. 1) First of all, what shell are you using? at least as written, but probably in general too. –HopelessN00b Jul 19 '12 at 13:37 Rotate your logs hourly, run analysis on the individual log, which happen to be

Having a problem logging in? Not the answer you're looking for? Why do units (from physics) behave like numbers? "Have permission" vs "have a permission" tr command has no effect when used in $() and saved in a variable more hot questions Browse other questions tagged linux shell-scripting or ask your own question.

done Sweet ....... Why would breathing pure oxygen be a bad idea? I only help the OP solved this problem. Fill in the Minesweeper clues Is this alternate history plausible? (Hard Sci-Fi, Realistic History) Windows is missing in GRUB!