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
HI there
I am trying to understand Shell scripting to create my own, I am attempting a few examples can anyone tell me what this means?n=$( expr $n + 1)Tried looking on the internet, but just cannot find its anywhere :( .Help please (4 Replies)
Discussion started by: steve2015
4 Replies
3. Homework & Coursework Questions
Hi All,
As per my knowledge in unix, my code looks fine. But still I am getting error (expr:syntax error). Please help me to resolve this error.
Script :
PRE_LBNO=0
PRE_DATE=0
TOT_PAY=0
TOT_REM=0
TOTAL=1
for Record_Type in `cut -c 1 Inputt.dat`
do
if ;
then
CURR_LBNO=` cut -c... (6 Replies)
Discussion started by: lathanandhini
6 Replies
4. Shell Programming and Scripting
Hi All,
I'm writing a shell script in KSH, where I want to store the filename, total record count and actual record count of all the source files. The source files reside in 4 different sub-folders under the same root folder.
Below is code:
#!/usr/bin/ksh... (6 Replies)
Discussion started by: jagari
6 Replies
5. Shell Programming and Scripting
Hi,
I am facing issues in my shell script while trying to add two variables. Look at the snippet below for details:
# Initially variable SAMPLE1 and SAMPLE2 are set from different sources. Have trucated decimal to avoid numeric errors in expr
SAMPLE1=`/usr/bin/top -n 1 | head -3 | tail -1... (3 Replies)
Discussion started by: animesh303
3 Replies
6. UNIX for Dummies Questions & Answers
Hi All,
This is a piece of code from one of my scripts:
t1=`cat temp3.21447 | grep WEALTHTOUC_TRANS_20100409_233127.txt.txt.TRG | awk '{print $3}' | cut -c1-5`
t2=`cat temp3.21447 | grep WEALTHTOUC_TRANS_20100409_233127.txt.txt.TRG | awk '{print $5}' | cut -c1-5`
#t1=23:43... (5 Replies)
Discussion started by: prachiagra
5 Replies
7. UNIX for Dummies Questions & Answers
hello to everyone,
i am writing a shell script in unix and i use the following command:
lnum= cut -f 1 -d : aa
passline=`expr $lnum + 1`
echo "$passline"
with the following command i get the value that is stored in the first field of the file "aa" and i save it in the variable "lnum". i am... (2 Replies)
Discussion started by: omonoiatis9
2 Replies
8. Shell Programming and Scripting
What is the difference between test expr VS .
For example :
if test 5 -eq 6
echo "Wrong"
and
if
echo "Wrong"
bot will give the same output as Wrong.
Now, what is the difference between these two? though they are producing the same result why we need two?
Any answer will be... (2 Replies)
Discussion started by: ashok.g
2 Replies
9. Shell Programming and Scripting
i want to get a substring from a string and used such shell script:
var_year=`expr substr "07132006" 5 4`
echo $var_year
but i got such error message: expr: syntax error. why?
Note: Kshell used on solaris 8. :confused: (5 Replies)
Discussion started by: robin.zhu
5 Replies
10. UNIX for Dummies Questions & Answers
Hello!
I want to evaluate some mathematical expressions in a script and I try to use 'expr' command.
Unfortunatally, when I have, for example,
expr 8.2 + 6
the result is 'expr: non-numeric argument'
Why ?
I work on SunOs 5.7.
Thanks in advance
Nathe (5 Replies)
Discussion started by: Nathe
5 Replies