Home > Bash Script > Bash Script Error Value Too Great For Base

Bash Script Error Value Too Great For Base

Contents

When was this language released? RudiC View Public Profile Find all posts by RudiC #4 11-19-2013 Chubler_XL Moderator Join Date: Oct 2010 Last Activity: 28 September 2016, 5:26 PM EDT Posts: 3,280 Skipping directly to level 4 Limit involving exponentials and arctangent without L'Hôpital Can I use an HSA as investment vehicle by overcontributing temporarily? You can avoid the error by using the solution described here: http://stackoverflow.com/a/12821845/1419315 if [[ ${vara#0} -lt ${varb#0} ]] or if [[ $((10#$vara)) -lt $((10#$varb)) ]] share|improve this answer edited May 11 http://sovidi.com/bash-script/bash-script-bus-error.php

it worked fine except when it came across numbers which started with 08 and 09 where it would abort that part of the script and continue to the next part without Not the answer you're looking for? Octal is > composed of '0' through '7'. Topics: Active | Unanswered Index »Programming & Scripting »Bash script aid - 'value too great for base' error Pages: 1 #1 2006-01-10 13:20:27 Komodo Member From: Oxford, UK Registered: 2005-11-03 Posts:

Bash Value Too Great For Base (error Token Is

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 How to pluralize "State of the Union" without an additional noun? Problem?

As for your list of if statements, you can use something like this instead: Code: if [[ $MONTH =~ ^[1-9]$ ]] ; then MONTH=${MONTH/#/0} fi if [[ $YESTERDAY =~ ^[1-9]$ ]] Browse other questions tagged scripting or ask your own question. However, this, like the true command, is considered to be slow. Bash Script Error Output Offline #5 2006-01-11 16:52:45 smoon Member Registered: 2005-08-22 Posts: 468 Website Re: Bash script aid - 'value too great for base' error Komodo wrote:(...) This is from http://www.codecoffee.com/tipsforlinux/ … 2/044.html ,

thanks man Sagar marked as solved for others who might find it useful Last edited by sagarhshah; January 26th, 2008 at 01:01 AM. Bash Value Too Great For Base 08 Password Home Search Forums Register Forum RulesMan PagesUnix Commands Linux Commands FAQ Members Today's Posts Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK But that's not how to populate an array. more hot questions question feed lang-sh about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

Hence 08 is not a valid number, and that's the reason for the error. Bash Script Error Log asked 4 months ago viewed 815 times active 4 months ago Linked 17 Why does bash thinks that 010 is 8? bash share|improve this question asked Jan 10 '14 at 16:45 user3178889 66127 1 You can't just subtract dates in the form YYYY-MM-DD. Otherwise, numbers take the form [base#]n, where the optional base is a decimal number between 2 and 64 representing the arithmetic base, and n is a number in that base.

Bash Value Too Great For Base 08

I had test this in SunOS 5.9, where commands don't have the actual sintax and i have to do calculations by myself with code. Reason: as stated David the H. Bash Value Too Great For Base (error Token Is If you need to reset your password, click here. Bash Script Error Command Not Found 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

I was asked to create a script that would go into our backup directories and delete/purge anything in the directory after a certain amount of days, normally I would be able http://sovidi.com/bash-script/bash-script-error-log.php Note that registered members see fewer ads, and ContentLink is completely disabled once you log in. For details and our forum data attribution, retention and privacy policy, see here current community chat Unix & Linux Unix & Linux Meta your communities Sign up or log in to 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. Bash Script Error Check

UNIX is a registered trademark of The Open Group. BTW, it seems faster than something like: n=${n#0000000000000000}; n=${n#00000000}; n=${n#0000}; n=${n#00}; n=${n#0}. –vinc17 Feb 16 '15 at 2:13 add a comment| Your Answer draft saved draft discarded Sign up or The following is just an example of how to fetch various strings for "yesterday". this contact form I can't replace the 0's as I need them for later on in the script.

Search Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... unix and linux commands - unix shell scripting Value Too Bash Script Error Message This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. Code: #!/bin/bash source /bb/infrastructure/generic/utils/etc/bkupperm.conf old_file() { local dtcmp=`date -d "$1" +"%F"`; shift local today=`date -d "$*" +"%F"` return `test $((today - dtcmp)) -lt 0` } #Main Logic cd $ENVR/database for filename

The actual grid in the problem has several hundred numbers and the example here is not an actual sample from it.

David the H. Either you need to get rid of the leading zeros or you tell bash to use base 10 (decimal) for these variables: REMAINING=$(( $DELAY - (( 10#$MINUTE + 60 ) - A variant of this question (removing leading/trailing spaces) appears at . Bash Script Error Exit As you have already seen, arithmetic is performed using the expr command.

Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. The time now is 08:28 PM. - Contact Us - Unix & Linux - unix commands, linux commands, linux server, linux ubuntu, shell script, linux distros. - Advertising - Top still the first error "value too great for base .." –user3178889 Jan 10 '14 at 16:58 As @robbrit says, remove the leading zero from 09 or better fix the navigate here Not the answer you're looking for?

I always appreciate your help! If base is less than or equal to 36, lowercase and uppercase letters may be used inter‐ changeably to represent numbers between 10 and 35. Adopt A Jet/Book Integral using residue theorem complex analysis Can I use an HSA as investment vehicle by overcontributing temporarily? I know there's one there - but I can't put my finger on it. –mikeserv Feb 16 '15 at 5:56 Thanks!

If it is Linux Related and doesn't seem to fit in any other forum then this is the place. The solution: filter out the 0; if you need to output a leading 0, there's printf %02d. On THE other hand or on another hand? It should be: $((1$n%((11$n-1$n)/10))).

Should indoor ripened tomatoes be used for sauce? Join our community today!