Home > Syntax Error > Bash Bc Standard_in 1 Syntax Error

Bash Bc Standard_in 1 Syntax Error

Contents

Religious supervisor wants to thank god in the acknowledgements A name for a well-informed person who is not believed? Thanks for the tip on awk. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. Not the answer you're looking for? navigate here

GTIN validation Will the medium be able to last 100 years? Run that line and then run declare -p randno4. Code: g echo $bal $amt 347.87 -742 g echo "$bal-$amt" | bc (standard_in) 1: syntax error g amt=742 g echo "$bal-$amt" | bc -394.13 g porphyry5 View Public Profile View Realism of a setting with several sapient anthropomorphic animal species Does mean=mode imply a symmetric distribution?

Bash Syntax Error Near Unexpected Token Done'

Browse other questions tagged bash syntax-error or ask your own question. Does that produce all the same errors? –Richard Fearn Jun 29 '10 at 19:14 vertical and earthmove are two c++ programs. no outgoing connection via ipv4 more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life So this line "for temp in $input" Is the same a "for temp in "input.file" which will only execute once with $input being the string "input.file".

How to extrude a face parallel to another? The time now is 07:26 PM. Should have been: Code: [email protected]:~$ bal=347.87; amt=-742; echo "$bal-$amt" | bc (standard_in) 1: syntax error [email protected]:~$ bal=347.87; amt=-742; echo "$bal- $amt" | bc 1089.87 Thank you. Bash Syntax Error Near Unexpected Token Then' Your post doesn't say what type of script you're writing.

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) What could cause the throttle to stick in my Ford Ranger? Does one of your CSV files have spaces or odd characters in its name? Registration is quick, simple and absolutely free.

Is the empty set homeomorphic to itself? Bash Syntax Error Near Unexpected Token Do' In other words, that command will always come back empty unless each line of input.file has "input.file" in it. 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 Specifically: Code: C=`cat $input | grep $temp | cut -f1` That echoes the file to stdin, greps against "input.file", and cuts the first field.

  • asked 6 years ago viewed 17155 times active 2 years ago Get the weekly newsletter!
  • Try adding tr to some pipe ... | tr "a-z" "A-Z" | ...
  • For example: 1 input.file 8 input.file 22 input.file And if the command result is empty, then the expression to bc isn't syntactically correct.

Bash Syntax Error Near Unexpected Token Else'

Is this safe to display MySQL query error in webpage if something went wrong? It is documented as "a random integer between 0 and 32767". –Etan Reisner Nov 26 '14 at 0:28 1 The man command should be pretty much the first Linux command Bash Syntax Error Near Unexpected Token Done' Registration is quick, simple and absolutely free. Bash Syntax Error Near Unexpected Token Fi' no outgoing connection via ipv4 Verbs of buttons on websites What to tell to a rejected candidate?

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 http://onlinetvsoftware.net/syntax-error/bash-if-expression-syntax-error.php How to indicate you are going straight? Train ride from Copenhagen to Malmo Video displays in Star Wars Is there a way to make a metal sword resistant to lava? Browse other questions tagged c bash shell bc or ask your own question. Bash Syntax Error Invalid Arithmetic Operator

grep echo bc share|improve this question edited Oct 14 '14 at 19:46 HalosGhost 3,01261733 asked Oct 14 '14 at 19:29 Suryakalpo Sarker 11 1 Please enable debugging by adding -x Can Customs make me go back to return my electronic equipment or is it a scam? Say I modified the script a little bit so it looks like this: #!/bin/bash NUM=$(echo "scale=25;$1/10" | bc) if [ $? -ne 0 ] then echo bad exit fi echo "$NUM" http://onlinetvsoftware.net/syntax-error/bash-if-syntax-error.php If you'd like to contribute content, let us know.

Perhaps you meant randno4='$(($RANDOM % 100001))'? –Etan Reisner Nov 25 '14 at 19:27 1 That first line is fine. Bash Syntax Error Near Unexpected Token Newline' Were slings used for throwing hand grenades? Problem?

porphyry5 View Public Profile View LQ Blog View Review Entries View HCL Entries Find More Posts by porphyry5 05-15-2011, 09:33 AM #9 Telengard Member Registered: Apr 2007 Location: USA

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 The problem is that there is something like "S:S:N:I::O:P..." in the file "$HOME/Documents/Development/road/Vertical/utest/$file.res" that's not in the corresponding file that's used in the other script. I'm not able to bring it to work. Bash Syntax Error Unexpected End Of File It works now :) The script looks like this now: #!/bin/bash # FREESPACE=`/usr/local/nagios/libexec/check_nt -H $2 -p 12489 -s Nag4AlphA \ -v USEDDISKSPACE -l $4 | awk -F"- " '{ print $4

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 However, the bash prompt returns (standard_in) 1: syntax error (standard_in) 1: syntax error (standard_in) 1: syntax error (standard_in) 1: syntax error (standard_in) 2: syntax error I have a hunch that this Why can a Gnome grapple a Goliath? http://onlinetvsoftware.net/syntax-error/bash-for-syntax-error.php Click Here to receive this Complete Guide absolutely free.

The question does not have to be directly related to Linux and any language is fair game. When was this language released? Having a problem logging in? An output sample larger than a single line would help.

F=$(echo "scale=0; 32+(1.8*$C)" | bc) The bc scale variable isn't contained in the expression. Why write an entire bash script in functions? share|improve this answer edited Dec 3 '15 at 12:50 answered Dec 3 '15 at 12:45 pmg 69k781138 add a comment| up vote 3 down vote You don't need to use bc. Join our community today!

Not the answer you're looking for? bash shell bc share|improve this question edited Jun 23 '14 at 11:43 asked Jun 23 '14 at 11:36 user2064000 562414 Are you willing to use awk?