Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-16-2003, 03:52 PM
|
#1
|
LQ Newbie
Registered: Jul 2003
Location: USA
Distribution: cpubuilders - Red Hat
Posts: 7
Rep:
|
Shell Script that misbehaves under Linux but works in HP UX well... ksh environ.
Hello,
I have this long shell script that I have ported to Linux from HPUX. It is running fine on HPUX. I am running it under ksh in both the places.
On Linux it gives me an error message that doesn't give me any clue to what is happening. The error message is this.
SquDex: binLinux/Milling[128]: 0.00: unexpected `.'
SquDex: binLinux/Milling[128]: 0.00: unexpected `.'
SquDex is the main program that I started and binLinux/Milling is the other program it calls in between. I have no idea what this means: 0.00: unexpected `.'
I tried to run set -vx, but that doesn't give me any clue. Is there a way to run shell scripts line by line and debug?
Or does anybody have any clue what such an error means?
THe program runs and gives me the out put but since this error message is coming, I cant run the program in the production env. Please let me know if anybody has any suggestions...
Regards
Thanks in anticipation...
|
|
|
09-16-2003, 05:03 PM
|
#2
|
LQ Guru
Registered: Mar 2003
Location: New Jersey
Distribution: Arch Linux
Posts: 1,445
Rep:
|
It means one of your lines is formatted wrong.
It could be missing a (") or a (.) or many other "grammatical" mistakes.
Or you had a typo and added an extra mark that is out of place.
The: (unexpected `.') makes me think you have a (.) somewhere when you shouldn't.
Check line 128.
|
|
|
09-16-2003, 05:13 PM
|
#3
|
Member
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333
Rep:
|
That looks like a error message from the program rather than from ksh.
I believe (that works for sh) add a -v to the first line which probably reads
# /bin/ksh
so it reads
#! /bin/ksh -v
That will show all commands that are getting executed. (I'm not 100% sure with ksh, always program in sh).
Or you could find the line where this SquDex is executed, and modify it so it says
echo " <the original line> "
and put
exit
behind it, so you will see how and with which parameters that program would have been called. Then try executing the same thing on the command line and see what you get.
Hope it helps,
mlp
|
|
|
09-17-2003, 12:46 PM
|
#4
|
LQ Newbie
Registered: Jul 2003
Location: USA
Distribution: cpubuilders - Red Hat
Posts: 7
Original Poster
Rep:
|
mlp,
Thanks. I think I saw the line where it is doing. It is taking a variable Bro and it is reading the value of that into another variable vBro. Bro should be integar, but somehow it came in as 0.00. How I can tell it to take only the integar value of it, like 0 only and not 0.00. Sorry for this silly question, but I am not a programmer.
Thanks
Regards
Sam
|
|
|
09-17-2003, 04:16 PM
|
#5
|
Member
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333
Rep:
|
If it's predictable that it's alway in the form x.y. and you always want x, you could do
Code:
vBro=` echo $vBro | awk -F. '{print $1}'`
(note the backquotes ``)
The awk splits the fields, using the dot as separator and gives you the first field (the first "0" in your case). But it might be easier to find out why the form is what it is.
Hope it helps,
mlp
|
|
|
09-17-2003, 04:21 PM
|
#6
|
LQ Newbie
Registered: Jul 2003
Location: USA
Distribution: cpubuilders - Red Hat
Posts: 7
Original Poster
Rep:
|
Thanks. I am a little bit afraid to open this program and make this sort of changes. If I send the two programs that uses this, will you be able to look at it?
Thanks
Bye
Sam
|
|
|
09-17-2003, 05:23 PM
|
#7
|
Member
Registered: Jun 2002
Location: NY
Distribution: Gentoo,RH
Posts: 333
Rep:
|
Well, yes, but what does it do? Why don't you post the script if it's not too big and I can have a look.
mlp
|
|
|
09-17-2003, 08:42 PM
|
#8
|
LQ Newbie
Registered: Jul 2003
Location: USA
Distribution: cpubuilders - Red Hat
Posts: 7
Original Poster
Rep:
|
mlp,
Thanks. IT comes to around 30 k as 4 files that are related. I guess we can't have attachments here in this forum. How can I send it. I think it will be too big for this place. I can e-mail it to you as an attachment. I can explain which program calls which also. Please let me know.
By the way, I tried your suggestion and it worked for one variable. I will have to do that for other three variables too looks like.... Thanks very much. But it bugs me why that error is coming at all. ...
Thanks
Bye
Sam
|
|
|
All times are GMT -5. The time now is 01:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|