10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
This is my code.... It works correct, but does not work with 4 and 5. My program is about finding average. so when i run 4 5 it gives me error "expr: non-integer argument".
But when i say sh average 45 67 it works. Whats wrong?how to fix it?
sum=0
n=0
if
then
for i in $*
do
if
... (2 Replies)
Discussion started by: Natalie
2 Replies
3. Shell Programming and Scripting
i wrote this simple shell script
#!/bin/bash
read N1
read N2
expr $N1 + $N2
it work fine in bash and i add it on xinetd for some test but when i try to use in with telnet i got this error :
ehsan@debian:~$ telnet 192.168.1.4 1234
Trying 192.168.1.4...
Connected to 192.168.1.4.... (14 Replies)
Discussion started by: niasha
14 Replies
4. Shell Programming and Scripting
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
5. Shell Programming and Scripting
I am running AIX 5.3 using the Korn Shell. I am reading file names from a file, as an example:
E0801260
E0824349
E0925345
EMPMSTR
statement "num=$(expr substr "$DDNAME" 4 2)
extracts the numeric values fine. But when I het the last entry, it returns num=MS, but I get an error... (19 Replies)
Discussion started by: kafkaf55
19 Replies
6. Shell Programming and Scripting
Hi all,
In KSH, I have got an error message like,
"expr: Integer argument too large"
I received this error message when I mutiply two large values and displaying the resultant output.
Is there any other altenative way to go with too large values?
Kindly let me know asap...
Thanks in... (12 Replies)
Discussion started by: iamgeethuj
12 Replies
7. UNIX for Dummies Questions & Answers
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
8. UNIX for Dummies Questions & Answers
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"... (4 Replies)
Discussion started by: Allenzo
4 Replies
9. UNIX for Dummies Questions & Answers
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
10. Shell Programming and Scripting
Hi everybody,
I want to know how can i use the command 'expr' to manipulate float number , i have a shell bash and when (for example) i do:
y1=`expr \( 1/ 16 \)`
it returns 0
and if i do
y1=`expr \( 1.6 / 16 \)`
it returns non numeric argument.
is there another command for mathematic... (4 Replies)
Discussion started by: mips
4 Replies