Sponsored Content
Full Discussion: Non Numeric Argument Error
Top Forums UNIX for Dummies Questions & Answers Non Numeric Argument Error Post 302221353 by Allenzo on Monday 4th of August 2008 09:41:09 AM
Old 08-04-2008
Non Numeric Argument Error

hi there,
I was recently introduced to this site by a friend. I hope you guys can help with a code error i can't seem to debug.I can get to add two different data types together. A snippet of the code is below:

echo -n "Enter Your MOnthly Investment"
read Inv
PIP= $(echo "scale=2; 10 / 100" | bc)
Amt=`echo $PIP "*" $Inv | bc`
PIP2= $(echo "scale=2; 15 / 100" | bc)
var=`echo $PIP2 "*" $Inv | bc`
Gr=`expr $Inv + $Amt`
Gross=`expr $Gr - $var`
echo "Your Accrued PIP amount is: $Amt"
echo "Your Accrued PIP2 amount is: $var"
echo "Gross Amount on your investment is: $Gross"
 

10 More Discussions You Might Find Interesting

1. Solaris

ps: 65535 is an invalid non-numeric argument for -p option

I want to figure out what is the reason of error message I have in Solaris 10. Why Solaris 10 dosn't recognize 65535? ps: 65535 is an invalid non-numeric argument for -p option usage: ps 'format' is one or more of: Thank you (5 Replies)
Discussion started by: gogogo
5 Replies

2. UNIX for Dummies Questions & Answers

non-numeric argument

quick question, I am trying to run this simple equation expr 2048 / 2.354 but get a "expr: non-numeric argument" error when ever its run. I believe it may be caused by the decimal point but I do not know how to remedy it. (3 Replies)
Discussion started by: TiredOrangeCat
3 Replies

3. Shell Programming and Scripting

Perl code to differentiate numeric and non-numeric input

Hi All, Is there any code in Perl which can differentiate between numeric and non-numeric input? (11 Replies)
Discussion started by: Raynon
11 Replies

4. UNIX for Dummies Questions & Answers

First argument is numeric or not

Hi everyone, I want my script to check if the first argument has only numbers or not. Im not sure what im doing wrong. This is how it looks like: if *") ] then echo 'The first arguement should only be in numeric' 1>&2 exit 1 else exit 0 fi (7 Replies)
Discussion started by: darkhider
7 Replies

5. Shell Programming and Scripting

Numeric sort error

Hello all I have data like below where the column with values (PRI, SEC ) is the char field and the rest are Numeric Fields. 200707,9580,58,7,2,1,PRI,1,1,137,205594,0,5,10,-45.51,-45.51 200707,9580,58,7,2,1,SEC,1,1,137,205594,0,5,10,-45.51,45.51... (1 Reply)
Discussion started by: vasuarjula
1 Replies

6. Shell Programming and Scripting

expr: non-numeric argument

Hi all, i am facing the error "expr: non-numeric argument" when i use the expr command. Following is the expression which i want to execute HR=$(echo `date +%H`) MIN=$(echo `date +%M`) TOT_MIN=`expr "$HR" \* 60+$MIN` | bc echo $TOT_MIN Here I am being reported with the error expr:... (6 Replies)
Discussion started by: sparks
6 Replies

7. UNIX for Dummies Questions & Answers

Find and Replace random numeric value with non-numeric value

Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is: 1702938475,SNU022,201004 the first 10 numbers always begin with 170 (6 Replies)
Discussion started by: Bahf1s
6 Replies

8. Shell Programming and Scripting

Numeric argument required

Hi, How to return the string "y" to the calling function. Getting the below error when function returns the value. return: y: numeric argument required With Regards (2 Replies)
Discussion started by: milink
2 Replies

9. UNIX for Advanced & Expert Users

Error:--test: argument expected--Even though i give an argument.

Hi All, I am running the script VBoxManage list vms |sed 's/"//g' | cut -d " " -f1 > har1out.mytxt result=`cat har1out.mytxt | grep $1' echo $result echo $1 { if then echo pass else echo fail fi (2 Replies)
Discussion started by: harsha85
2 Replies

10. Shell Programming and Scripting

Expr: non-numeric argument syntax error on line 1, teletype

Hi, I tried to look up the issue i'm experiencing, but i'm confused what's wrong with my script. After executing the script I'm getting the following error expr: non-numeric argument syntax error on line 1, teletype After some research, it seems that the problem relates to bc. I have... (1 Reply)
Discussion started by: nms
1 Replies
MORE(1) 							   User Commands							   MORE(1)

NAME
more -- file perusal filter for crt viewing SYNOPSIS
more [-dlfpcsu] [-num] [+/pattern] [+linenum] [file ...] DESCRIPTION
more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements. OPTIONS
Command-line options are described below. Options are also taken from the environment variable MORE (make sure to precede them with a dash (``-'')) but command line options will override them. -num This option specifies an integer which is the screen size (in lines). -d more will prompt the user with the message "[Press space to continue, 'q' to quit.]" and will display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed. -l more usually treats ^L (form feed) as a special character, and will pause after any line that contains a form feed. The -l option will prevent this behavior. -f Causes more to count logical, rather than screen lines (i.e., long lines are not folded). -p Do not scroll. Instead, clear the whole screen and then display the text. Notice that this option is switched on automatically if the executable is named page. -c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed. -s Squeeze multiple blank lines into one. -u Suppress underlining. +/ The +/ option specifies a string that will be searched for before each file is displayed. +num Start at line number num. COMMANDS
Interactive commands for more are based on vi(1). Some commands may be preceded by a decimal number, called k in the descriptions below. In the following descriptions, ^X means control-X. h or ? Help: display a summary of these commands. If you forget all the other commands, remember this one. SPACE Display next k lines of text. Defaults to current screen size. z Display next k lines of text. Defaults to current screen size. Argument becomes new default. RETURN Display next k lines of text. Defaults to 1. Argument becomes new default. d or ^D Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default. q or Q or INTERRUPT Exit. s Skip forward k lines of text. Defaults to 1. f Skip forward k screenfuls of text. Defaults to 1. b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes. ' Go to place where previous search started. = Display current line number. /pattern Search for kth occurrence of regular expression. Defaults to 1. n Search for kth occurrence of last r.e. Defaults to 1. !<cmd> or :!<cmd> Execute <cmd> in a subshell v Start up an editor at current line. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined. ^L Redraw screen :n Go to kth next file. Defaults to 1. :p Go to kth previous file. Defaults to 1. :f Display current file name and line number . Repeat previous command ENVIRONMENT
More utilizes the following environment variables, if they exist: MORE This variable may be set with favored options to more. SHELL Current shell in use (normally set by the shell at login time). TERM Specifies terminal type, used by more to get the terminal characteristics necessary to manipulate the screen. SEE ALSO
vi(1), less(1) AUTHORS
Eric Shienbrood, UC Berkeley Modified by Geoff Peck, UCB to add underlining, single spacing Modified by John Foderaro, UCB to add -c and MORE environment variable HISTORY
The more command appeared in 3.0BSD. This man page documents more version 5.19 (Berkeley 6/29/88), which is currently in use in the Linux community. Documentation was produced using several other versions of the man page, and extensive inspection of the source code. AVAILABILITY
The more command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. util-linux February 2011 util-linux
All times are GMT -4. The time now is 04:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy