10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
---------- Post updated at 01:58 PM ---------- Previous update was at 01:48 PM ----------
For some reason my question is not getting printed. Here are the details:
Greetings.
I would like to add/subtact an integer to/from two columns of integers. I feel like this should be easy using awk... (3 Replies)
Discussion started by: Twinklefingers
3 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
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
4. Shell Programming and Scripting
Hi,
I am trying to execute a simple script as below to compare a value from a file and copy that line based on a condition.
while read line
do
code_check = `expr substr "$line" 6 1`
if ; then
echo "${line}" >> /temp/bill/push_updated.dat
else
echo "line ignored"
fi
done <... (8 Replies)
Discussion started by: ramkiran77
8 Replies
5. 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
6. Shell Programming and Scripting
How to convert string into an integer or number
For example :
% set tim = `date`
% echo $tim
Tue Feb 22 16:25:08 IST 2011
here How to increment time by 10 hrs
like 16+10 , here 16 is a string in date cmd. .. how to convert 16 to an integer and added to a another nimber ?
Thanks... (3 Replies)
Discussion started by: sbhamidi
3 Replies
7. Shell Programming and Scripting
How to add two number from two different file using expr command ?? (3 Replies)
Discussion started by: aliahsan81
3 Replies
8. 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
9. UNIX for Dummies Questions & Answers
Srr for being pain her
let say i have a data in a file like this
1@1000
2@2000
4@4000
5@7770
6@8998
7@80008
i am a newbie in Unix
i need to add a comma to integer using AWK function. for example, 1,000 or 80,008
how can i do that
ps. i'm using bash shell (1 Reply)
Discussion started by: Nutter
1 Replies
10. Shell Programming and Scripting
I am trying to create a script that will read from a file two non-integer values (decimals) and add those values together. For example, I want to add 1.51 and -2.37 together and get the sum. Any ideas? Thanks! (2 Replies)
Discussion started by: limshady411
2 Replies