Home > Syntax Error > Bash Bc Standard_in 1 Syntax Error

Bash Bc Standard_in 1 Syntax Error

Contents

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 Why does Windows show "This device can perform faster" notification if I connect it clumsily? LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] Bash subtract negative number using bc User Name Remember Me? I used simply "n" as the index name because it is a idiomatic. Check This Out

catkin View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by catkin View Blog 05-15-2011, 07:20 AM #3 druuna LQ Veteran Registered: Sep An output sample larger than a single line would help. Password Programming This forum is for all programming questions. Password Protected Wifi, page without HTTPS - why the data is send in clear text?

Bash Syntax Error Near Unexpected Token Done'

porphyry5 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by porphyry5 Tags bc Thread Tools Show Printable Version Email this Page Search this only prints return value if return = 01grep: Syntax error near unexpected token `('1How can I stop grep returning itself1Bash - syntax in echo0Unix command to return maximum float value out Try surrounding the variable that holds a file name in quotes: "\"${filename}\"" share|improve this answer answered Jun 29 '10 at 21:35 pborenstein 32614 The only files that are currently

  1. Is this safe to display MySQL query error in webpage if something went wrong?
  2. Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap - Main Menu Linux Forum Android Forum Chrome OS Forum Search LQ
  3. In other words, that command will always come back empty unless each line of input.file has "input.file" in it.

Meaning that space separation is generally true for all linux command-line apps? HO related stuff 122 stuff Terms & services -Privacy -Rss Sign in -Sign up For programmers by programmers Tag v2.0.1 current community blog chat Server Fault Meta Server Fault your communities not if = (but that's derived from IBM mainframe JCL) and sometimes long options need --

Using the name "readings" or "temperatures" or "temps" for the variable might be better also. Bash Syntax Error Near Unexpected Token Else' I can't really advocate this dc junk anyways—it's only good to be left in this comment area. –gniourf_gniourf Jun 23 '14 at 12:19 1 @gniourf_gniourf - it's pretty crazy fast, Realism of a setting with several sapient anthropomorphic animal species How to pluralize "State of the Union" without an additional noun? Would be substantially easier. –Bernhard Jun 23 '14 at 11:46 2 You're just missing a trailing endline for the bc command: compare printf '(5.13232+2.479+1.4311+0)/3' | bc -l with echo '(5.13232+2.479+1.4311+0)/3'

Another thing might be that it's bc complaining about the "script" it's given. Bash Syntax Error Near Unexpected Token Do' from the '$(echo ... | bc)' command. –Jonathan Leffler Feb 25 '10 at 6:04 yes, thanks for the correction. –ghostdog74 Feb 25 '10 at 6:07 I clarified Browse other questions tagged c bash shell bc or ask your own question. Finding a file starting with '-' dash A simple visual puzzle to die for How to handle spending money for extended trip to Europe?

Bash Syntax Error Near Unexpected Token Else'

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 your loop contents operating on $input[n] in each loop ... Bash Syntax Error Near Unexpected Token Done' Yes, of course I'm an adult! Bash Syntax Error Near Unexpected Token Fi' Join our community today!

Why does Windows show "This device can perform faster" notification if I connect it clumsily? his comment is here Hard to say while we cannot see your script and without knowing what it is supposed to do... –krisFR Apr 20 '15 at 12:04 Thanks for the replies! In other words, are the line edings correct? One works and one doesn't and I can't figure out what's going on. Bash Syntax Error Invalid Arithmetic Operator

Code: for temp_c ... Dennis numbers 2.0 Video displays in Star Wars Can a creature benefit from differently typed speed bonuses all named fast movement? Meaning of Guns and ghee Force Microsoft Word to NEVER auto-capitalize the name of my company How to handle spending money for extended trip to Europe? http://gatoisland.com/syntax-error/bash-for-syntax-error.php share|improve this answer answered Jun 29 '10 at 22:20 Dennis Williamson 167k42235305 flatroad.res (the only .res file in the directory at this time) contains only "0.0" (minus the quotes)

Thanks Tim timmay9162 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by timmay9162 04-26-2006, 02:32 AM #9 jschiwal LQ Guru Registered: Bash Syntax Error Near Unexpected Token Newline' See http://wiki.bash-hackers.org/syntax/arith_expr And finally, like Etan Reisner said, You also use $randno3 in the t_twall assignment line which is undefined share|improve this answer edited Nov 26 '14 at 6:48 answered Nov This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant.

What does the "Phi" sign stand for in musical notation?

When was this language released? Using a for loop serves no purpose in your program. Not the answer you're looking for? Bash Syntax Error Unexpected End Of File Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now If you have any problems with the registration process or your account login, please contact us.

I checked that the variables assigned from the grep command have been assigned correctly. Convince people not to share their password with trusted others Is the following extension of finite state automata studied? How does the pilot control the Dassault Rafale? http://gatoisland.com/syntax-error/bash-if-syntax-error.php I'm not able to bring it to work.

Password Programming This forum is for all programming questions. catkin View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by catkin View Blog 05-17-2011, 11:12 AM #11 porphyry5 Member Registered: Jul 2010 Registration is quick, simple and absolutely free. asked 10 months ago viewed 449 times active 10 months ago Related 3(standard_in) 1: parse error0-bash syntax error “fi”-1bash script / standard_in 1: syntax error-4Syntax error running command bc under bash

There are plenty more lines where the "..." is, but they're basically just a variation on the same idea. Last edited by jschiwal; 04-24-2006 at 04:12 PM. If not, why? The parse error is due to the $randno3 typo. –Etan Reisner Nov 26 '14 at 0:19 add a comment| Your Answer draft saved draft discarded Sign up or log in

It just doesn't do what you think it does. Quote: foo$ minuend=5 foo$ subtrahend=-5 foo$ echo "$minuend-($subtrahend)" 5-(-5) foo$ echo "$minuend-($subtrahend)" | bc 10 foo$ Telengard View Public Profile View LQ Blog View Review Entries View HCL Entries View share|improve this answer answered Jun 23 '14 at 11:49 goldilocks 47.6k1096146 add a comment| up vote 3 down vote bc has some pretty particular syntax. Are there any 'smart' ejection seats?

Unix & Linux Stack Exchange works best with JavaScript enabled current community chat Stack Overflow Meta Stack Overflow your communities Sign up or log in to customize your list. jschiwal View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by jschiwal 04-24-2006, 04:11 PM #5 Dark_Helmet Senior Member Registered: Jan 2003 Posts: Join them; it only takes a minute: Sign up Standard_in error in bash script up vote 6 down vote favorite I have two bash scripts that are almost identical. what is the difference between \twocolumn and \documentclass[twocolumn]{book} Is the standard Canon 18-55 lens the same as 5 years ago?

EDIT 1: Here's the script #!/bin/bash FREESPACE=`/usr/local/nagios/libexec/check_nt -H $2 -p 12489 -s PASSWORD \ -v USEDDISKSPACE -l $4 | awk -F"- " '{ print $4 }' | awk -F "|" '{ Is there a good way to get from Levoča to Lviv? The question does not have to be directly related to Linux and any language is fair game. Thanks for the tip on awk.

start=$(nm -S a.out | grep -w _start) start_addr=${start%% *} # Shorter, more efficient myfun=$(nm -S a.out | grep "$1") read myfun_addr myfun_length rest <<< "$myfun" # Shorter, more efficient echo $myfun_length What's its output? Main Menu LQ Calendar LQ Rules LQ Sitemap Site FAQ View New Posts View Latest Posts Zero Reply Threads LQ Wiki Most Wanted Jeremy's Blog Report LQ Bug Syndicate Latest

© Copyright 2017 gatoisland.com. All rights reserved.