Sponsored Content
Top Forums Shell Programming and Scripting Display Error [: : integer expression expected Post 302398221 by clx on Wednesday 24th of February 2010 04:09:11 AM
Old 02-24-2010
what I was trying to say is please check whether the $remspace and $xsize contains some integer value.

what is the value of these variables? try putting echo and debug.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

integer expression expected error

I'm a beginner so I might make beginner mistakes. I want to count the "#define" directives in every .C file I get the following errors: ./lab1.sh: line 5: ndef: command not found ./lab1.sh: line 6: #!/bin/sh for x in *. do ndef = 'grep -c \#define $x' if ; then ... (2 Replies)
Discussion started by: dark_knight
2 Replies

2. Shell Programming and Scripting

integer expression expected error crontab only

I created a bash script that ran fine for awhile on a nightly crontab but then started crashing with commands not found, so I added PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/home/homedir/scripts/myscriptdir export PATH and now I don't get those errors, but... (2 Replies)
Discussion started by: unclecameron
2 Replies

3. Shell Programming and Scripting

New to shellscripting error: ./emailnotifications.sh: line 43: [: FH: integer expression expected

Hi , I'm a beginner in unix shell scripting need help in rectifying an error Source file :test.txt with Header ------ ----- Trailer ex: FH201010250030170000000000000000 abc def jke abr ded etf FE2 I was validating whether the header begin... (2 Replies)
Discussion started by: dudd9
2 Replies

4. Shell Programming and Scripting

if script error: integer expression expected

Hi, i am making a simple program with a optional -t as the 3rd parameter. Submit course assignment -t dir In the script, i wrote: #!/bin/bash echo "this is course: ${1}" echo "this is assignment #: ${2}" echo "late? : ${3}" if then echo "this is late" fi but this gives me a :... (3 Replies)
Discussion started by: leonmerc
3 Replies

5. Shell Programming and Scripting

Integer expression expected: with regular expression

CA_RELEASE has a value of 6. I need to check if that this is a numeric value. if not error. source $CA_VERSION_DATA if * ] then echo "CA_RELESE $CA_RELEASE is invalid" exit -1 fi + source /etc/ncgl/ca_version_data ++ CA_PRODUCT_ID=samxts ++ CA_RELEASE=6 ++ CA_WEEK_NO=7 ++... (3 Replies)
Discussion started by: ketkee1985
3 Replies

6. Shell Programming and Scripting

Error: integer expression expected

root@server01 # df -h | grep /tmp | awk {'print $3}' 252M root@server01 # root@server01 # cat /usr/local/tmpchk.sh #!/bin/sh x=`df -h | grep /tmp | awk {'print $3}'` if ; then rm -fr /tmp/somefolder/ else echo "its small" (2 Replies)
Discussion started by: fed.linuxgossip
2 Replies

7. UNIX for Dummies Questions & Answers

Integer expression expected error in script

When i run the following code i get an error that says Integer expression expected! How do i fix this? #!/bin/bash if ;then echo "wrong" exit 1 fi if ;then for i in /dev;do if ;then echo $i ls -l fi (4 Replies)
Discussion started by: kotsos13
4 Replies

8. Shell Programming and Scripting

if condition error: integer expression expected

I am trying to run following condition with both variables having numeric values "1,2,3" if ;when i run it i get following error: $NEW_STATE: integer expression expected Please correct me where I'm doing wrong. I'm trying to check either New State is greater or Old state.... (0 Replies)
Discussion started by: kashif.live
0 Replies

9. Shell Programming and Scripting

Getting error in bash script; expr $a + 1: integer expression expected

Hi, I am new to shell/bash script. I am trying to run below script #!/bin/bash a=0 b=10 if then echo "a is equal to be" else echo "a is not equal to be" fi MAX=10 while do echo $a a='expr $a + 1' done (1 Reply)
Discussion started by: Mallikgm
1 Replies

10. Shell Programming and Scripting

Integer expression expected

Hello , This is the piece of the code which is giving me trouble if ;then exit_proc "${SOURCEDIR}/${OUT_FILE} does not exists or not readable" 2 else word_count=`wc -l < ${SOURCEDIR}/$OUT_FILE` fi if ;then exit_proc "Word_count is more than allowed limit" 1 else... (6 Replies)
Discussion started by: Sri3001
6 Replies
Imager::Font::Wrap(3pm) 				User Contributed Perl Documentation				   Imager::Font::Wrap(3pm)

NAME
Imager::Font::Wrap - simple wrapped text output SYNOPSIS
use Imager::Font::Wrap; my $img = Imager->new(xsize=>$xsize, ysize=>$ysize); my $font = Imager::Font->new(file=>$fontfile); my $string = "..."; # text with or without newlines Imager::Font::Wrap->wrap_text( image => $img, font => $font, string => $string, x => $left, y => $top, width => $width, .... ); DESCRIPTION
This is a simple text wrapper with options to control the layout of text within the line. You can control the position, width and height of the text with the "image", "x", "y", "width" and "height" options. You can simply calculate space usage by setting "image" to "undef", or set "savepos" to see how much text can fit within the given "height". wrap_text() Draw word-wrapped text. o "x", "y" - The top-left corner of the rectangle the text is formatted into. Defaults to (0, 0). o "width" - The width of the formatted text in pixels. Defaults to the horizontal gap between the top-left corner and the right edge of the image. If no image is supplied then this is required. o "height" - The maximum height of the formatted text in pixels. Not required. o "savepos" - The amount of text consumed (as a count of characters) will be stored into the scalar this refers to. my $pagenum = 1; my $string = "..."; my $font = ...; my $savepos; while (length $string) { my $img = Imager->new(xsize=>$xsize, ysize=>$ysize); Imager::Font::Wrap->wrap_text(string=>$string, font=>$font, image=>$img, savepos => $savepos) or die $img->errstr; $savepos > 0 or die "Could not fit any text on page "; $string = substr($string, $savepos); $img->write(file=>"page$pagenum.ppm"); } o "image" - The image to render the text to. Can be supplied as "undef" to simply calculate the bounding box. o "font" - The font used to render the text. Required. o "size" - The size to render the font in. Defaults to the size stored in the font object. Required if it isn't stored in the font object. o "string" - The text to render. This can contain non-white-space, blanks (ASCII 0x20), and newlines. Newlines must match /(?:x0Ax0D?|x0Dx0A?)/. White-space other than blanks and newlines are completely ignored. o "justify" The way text is formatted within each line. Possible values include: o "left" - left aligned against the left edge of the text box. o "right" - right aligned against the right edge of the text box. o "center" - centered horizontally in the text box. o fill - all but the final line of the paragraph has spaces expanded so that the line fills from the left to the right edge of the text box. o "linegap" - Gap between lines of text in pixels. This is in addition to the size from "$font->font_height". Can be positive or negative. Default 0. Any other parameters are passed onto Imager::Font->draw(). Returns a list: ($left, $top, $right, $bottom) which are the bounds of the space used to layout the text. If "height" is set then this is the space used within that height. You can use this to calculate the space required to format the text before doing it: my ($left, $top, $right, $bottom) = Imager::Font::Wrap->wrap_text(string => $string, font => $font, width => $xsize); my $img = Imager->new(xsize=>$xsize, ysize=>$bottom); Imager::Font::Wrap->wrap_text(string => $string, font => $font, width => $xsize, image => $image); BUGS
Imager::Font can handle UTF-8 encoded text itself, but this module doesn't support that (and probably won't). This could probably be done with regex magic. Currently ignores the "sizew" parameter, if you supply one it will be supplied to the draw() function and the text will be too short or too long for the "width". Uses a simplistic text model, which is why there's no hyphenation, and no tabs. AUTHOR
Tony Cook <tony@develop-help.com> SEE ALSO
Imager(3), Imager::Font(3) perl v5.14.2 2011-06-06 Imager::Font::Wrap(3pm)
All times are GMT -4. The time now is 08:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy