Sponsored Content
Top Forums UNIX for Beginners Questions & Answers If condition is not working and getting error Post 302990250 by Torrid on Tuesday 24th of January 2017 05:12:00 AM
Old 01-24-2017
you were partially correct robin.

I am new to shell script and learning through online. when I search for help I got this forum and posted my query.

if made a change in IF statement it is working fine

Code:
if [[ $SCORE -gt 100 || $SCORE -lt 0  ]] ; then

but getting below error when i give 09 as input


Code:
./score1.sh
Enter your score [0-100%] ('q' for quit): 09
./score1.sh: line 12: [[: 09: value too great for base (error token is "09")
./score1.sh: line 12: [[: 09: value too great for base (error token is "09")
./score1.sh: line 18: 0 + 09: value too great for base (error token is "09")
Exit.

Moderator's Comments:
Mod Comment Seriously: Please use CODE tags as required by forum rules!

Last edited by RudiC; 01-24-2017 at 07:06 AM.. Reason: Added CODE tags.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If condition not working

Hi Gurus, I have shell script in which i have to check if time is between to possible value or not. For that i am using following line of code if then echo 'Found In Between' echo $ftime ... (5 Replies)
Discussion started by: MANISH KU
5 Replies

2. Shell Programming and Scripting

error in if-else condition

Hi.. Im using the following script to find whether the present day is monday or not. If it is monday it has to do a specific set of things. #!/bin/sh Present_Date=`date` LOAD_DAY=`date -d "$Present_Date" | cut -d " " -f 1` echo $LOAD_DAY if ;then echo "Monday" #statements;... (6 Replies)
Discussion started by: abala
6 Replies

3. Shell Programming and Scripting

wild card in if condition not working

Hi, I am using RHEL5. I have following if condition. if In the above condition, if the value of a contains word WARNING, it should match. i.e., WARNING_MESSAGE, CRITICAL WARNING, WARNING ALERT etc. it should match. For b, alert error, ALERT ERROR, ERROR IMMEDIATE ACTION REQUIRED, etc... (2 Replies)
Discussion started by: user7509
2 Replies

4. UNIX for Advanced & Expert Users

If condition and htm not working

checkSync() { CONNECT_STRING=TLDB61/TLDB61@TL10G SQLPLUS_SETTINGS="SET PAGESIZE 0 LINESIZE 1500 ECHO OFF TRIMS ON TAB OFF FEEDBACK OFF HEADING OFF" SQL_RESULT_SYNC_PMCM=`sqlplus -s ${CONNECT_STRING} << EOF ${SQLPLUS_SETTINGS} (SELECT... (2 Replies)
Discussion started by: madfox
2 Replies

5. Shell Programming and Scripting

Using ssh to transfer file not working inside if-condition

Hi all, ssh uname@remote_server 'cat /tmp/remote_file_name > home_dir/a512386/new/local_file_name' The above given command is working fine. but if i try to move the file only if exists in the remote server i.e) giving the same within if condition it executes but the file is not stored in my... (1 Reply)
Discussion started by: Shri123
1 Replies

6. Shell Programming and Scripting

Condition error!

Hi Guys, Can you please help me to check if my condition is correct. if && then if ; then # active SE_USERID_LUZON_5="A" elif ; then # not active SE_USERID_LUZON_5="D" ${ECHO_CMD}... (3 Replies)
Discussion started by: nikki1200
3 Replies

7. Shell Programming and Scripting

while condition error:

I'm trying to run following code: while do echo "Hello World" done but I'm getting error on first line: ./test: line 1: syntax error near unexpected token `(' can anyone please tell me who can i run this loop. Also please tell me what will be syntax of do while loop in case i... (11 Replies)
Discussion started by: kashif.live
11 Replies

8. UNIX for Dummies Questions & Answers

error in if condition

Hi All, I need to compare the header of the input files which can be comma demilited, tild(~) or Pipr(|) seperated file. I am comparing the file header by taking 1st row and comparing it with input row: Below is the actual code:(ksh script) if then echo $dat >>... (4 Replies)
Discussion started by: abhi_123
4 Replies

9. Shell Programming and Scripting

Error: if condition

please follow below code if ; then its giving me an error as "test1.sh: line 3: r=$(eval echo '$lck_'$TABLE != "") if can anyone tell me how to do inside if condition...with out use any variable.. TIA (6 Replies)
Discussion started by: gnnsprapa
6 Replies

10. Shell Programming and Scripting

If condition on shell not working , not sure what is the mistake I am doing?

I have a requirement to perform specific set of tasks based on server , So I want to have the condition(s) defined based on server. Here is the script I came up with and I have read multiple blogs and couldn`t find any mistake from my script. Can you guide on what I am overlooking here ? ... (2 Replies)
Discussion started by: Varja
2 Replies
Locale::Script(3perl)					 Perl Programmers Reference Guide				     Locale::Script(3perl)

NAME
Locale::Script - standard codes for script identification SYNOPSIS
use Locale::Script; $script = code2script('phnx'); # 'Phoenician' $code = script2code('Phoenician'); # 'Phnx' $code = script2code('Phoenician', LOCALE_CODE_NUMERIC); # 115 @codes = all_script_codes(); @scripts = all_script_names(); DESCRIPTION
The "Locale::Script" module provides access to standards codes used for identifying scripts, such as those defined in ISO 15924. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 15924 four-letter codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying scripts. The ones currently supported are: alpha This is a set of four-letter (capitalized) codes from ISO 15924 such as 'Phnx' for Phoenician. This code set is identified with the symbol "LOCALE_SCRIPT_ALPHA". The Zxxx, Zyyy, and Zzzz codes are not used. This is the default code set. numeric This is a set of three-digit numeric codes from ISO 15924 such as 115 for Phoenician. This code set is identified with the symbol "LOCALE_SCRIPT_NUMERIC". ROUTINES
code2script ( CODE [,CODESET] ) script2code ( NAME [,CODESET] ) script_code2code ( CODE ,CODESET ,CODESET2 ) all_script_codes ( [CODESET] ) all_script_names ( [CODESET] ) Locale::Script::rename_script ( CODE ,NEW_NAME [,CODESET] ) Locale::Script::add_script ( CODE ,NAME [,CODESET] ) Locale::Script::delete_script ( CODE [,CODESET] ) Locale::Script::add_script_alias ( NAME ,NEW_NAME ) Locale::Script::delete_script_alias ( NAME ) Locale::Script::rename_script_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::add_script_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Script::delete_script_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes man page. SEE ALSO
Locale::Codes Locale::Constants http://www.unicode.org/iso15924/ Home page for ISO 15924. AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 1997-2001 Canon Research Centre Europe (CRE). Copyright (c) 2001-2010 Neil Bowers Copyright (c) 2010-2011 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-09-26 Locale::Script(3perl)
All times are GMT -4. The time now is 11:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy