Sponsored Content
Top Forums Shell Programming and Scripting ksh-script "arithmetic syntax error" comparing strings Post 302361908 by old_mike on Wednesday 14th of October 2009 10:26:03 AM
Old 10-14-2009
ksh-script "arithmetic syntax error" comparing strings

Hi all,

Iīve already searched the forum but canīt find what i am doing wrong.
I am trying to compare two variables using ksh under red hat. The error I get is:

-ksh: .[123]: [: 75e245dfe25b753cfd69987a314adfe7: arithmetic syntax error

Below are the lines of the script, line 123 is the if-line, MDA and MDB values are correct, near the brackets there is only one space:

Code:
MDA=`md5sum /tmp/ftp_dir_after_transfer | cut -d' ' -f1 `
MDB=`md5sum /tmp/ftp_dir_before_transfer | cut -d' ' -f1 `
if [ $MDA -eq $MDB ];
then
echo "wrong" 
 else
echo "correct" 
fi

Thanks for your support
old_mike

Last edited by old_mike; 10-14-2009 at 11:33 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

"syntax error at line 21 :'done' unexpected." error message"

I am trying to run the script bellow but its given me "syntax error at line 20 :'done' unexpected." error message" can someone check to see if the script is ok? and correct me pls. Today is my first day with scripting. Gurus should pls help out #!/bin/ksh # Purpose: Check to see if file... (3 Replies)
Discussion started by: ibroxy
3 Replies

2. HP-UX

script running with "ksh" dumping core but not with "sh"

Hi, I have small script written in korn shell. When it is called from different script, its dumping core, but no core dump when we run it standalone. And its not dumping core if we run the script using "/bin/sh" instead of "ksh" Can some body please help me how to resolve this issue. ... (9 Replies)
Discussion started by: simhe02
9 Replies

3. Shell Programming and Scripting

KSH Redirect to Pipe (">|") Syntax

Occasionally I see this in ksh scripts: somepgm >| someoutputfile This appears to be redirecting the output of somepgm to the file someoutputfile, and it does do so. But when you remove the pipe symbol "|" from this command, output simply goes to the screen (stdout). Why do we need the... (6 Replies)
Discussion started by: Tanuka
6 Replies

4. Shell Programming and Scripting

Syntax error near unexpected token `"Hit <ENTER> to continue:"'

the below code will search attr string inside makefile under the modelno on given path. echo "Enter model no for searching string inside makefile" read inputs2 #find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \; #;;I am getting below error.... (7 Replies)
Discussion started by: lathigara
7 Replies

5. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

6. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

7. HP-UX

HP-UX: Shell Script giving " 0^J30: Syntax error"

Hi All, We are getting a very unique error while running a shell script on HP-UX box. Can somebody help in this regards? The shell script is working fine on linux/solaris box. Error: ++++++++++++++++++++++++ $/test.sh ./test.sh: 0^J30: Syntax error $ ++++++++++++++++++++++++ TIA.... (16 Replies)
Discussion started by: vai_sh
16 Replies

8. Shell Programming and Scripting

ksh Arithmetic syntax error while comparing decimal numbers

Hello, I am having a problem when i execute following script on RHEL 6.4. Same script works fine on another machine where I have same version of RHEL and KSH. Below is the rpm and RHEL version. ossvm12(0)> rpm -qa | grep ksh ksh-20100621-19.el6.x86_64 ossvm12(0)> cat... (7 Replies)
Discussion started by: Adithya Gokhale
7 Replies

9. BSD

Keep getting error "-bash: ./.profile_z2: line 52: syntax error: unexpected end of file"

#!/bin/bash #-------------------------------------------------------- # Setup prompt # Author Zeeshan Mirza # Data: 06-08-2017 #-------------------------------------------------------- if then . ./.profile_custom_pre fi umask 022 set -o vi export EDITOR=vi export VISUAL=vi... (3 Replies)
Discussion started by: getzeeshan
3 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
MDBTools(1)															       MDBTools(1)

NAME
mdb-ver - Return the format of a given MDB database. SYNOPSIS
mdb-ver database mdb-ver -M DESCRIPTION
mdb-ver is a utility program distributed with MDB Tools. It will return a single line of output with either 'JET3' for those files produced in Access 97 format or 'JET4' for those produced by Access 2000 and XP. OPTIONS
-M Prints the version of MDB Tools itself instead of the MDB file. NOTES
Access changed its format between Jet 3 used in Access 97 and Jet 4 used for Access 2000 and XP. The nature of the changes included moving the page size from 2K to 4K and added support for unicode. MDB Tools actively supports both formats. ENVIRONMENT
MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. MDBOPTS semi-column separated list of options: o use_index o no_memo o debug_like o debug_write o debug_usage o debug_ole o debug_row o debug_props o debug_all is a shortcut for all debug_* options HISTORY
mdb-ver first appeared in MDB Tools 0.4. SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) AUTHORS
The mdb-ver utility was written by Brian Bruns. BUGS
mdb-ver does minimal checking on the validity of a file. It is possbile for it to misidentify a non-MDB file. mdb-ver does not recognize Access 2.0 (Jet 2) or the newer MSDE format files. 0.7 13 July 2013 MDBTools(1)
All times are GMT -4. The time now is 07:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy