LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-29-2010, 06:10 AM   #1
basher400
Member
 
Registered: Mar 2005
Posts: 51

Rep: Reputation: 15
32512 error code in Perl when trying to run shell command


hi

when I execute the command from the shell command line - it works and no error code.
if I do the exact same command from a perl file - it fails with code 32512.
the file is created from the same perl script that runs the command that fails. file permission is 0664.

Code:
#! /usr/local/pkg/perl-5.8.8/bin/perl

print "Content-type: text/html\n\n";

my $commandStr="babel -icif '/mypath/butadiene.cif' -opdb '/mypath/butadiene.cif'";

my $cmdResults=`$commandStr` or print "error code: $?, error string: $!";
result:
Quote:
error code: 32512, error string:
what could error code 32512 mean in this case? why is it working from the command line and not from the perl script?

Last edited by basher400; 11-29-2010 at 07:10 AM.
 
Old 11-29-2010, 08:11 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,488

Rep: Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543Reputation: 2543
Could be because the "babel" command isn't in your path when you run the script. Did you try to specify the entire fully-qualified path to babel? And did you notice that both your input and output files are the same??
 
Old 11-29-2010, 09:18 AM   #3
wje_lq
Member
 
Registered: Sep 2007
Location: Mariposa
Distribution: Debian lenny, Slackware 12
Posts: 808

Rep: Reputation: 178Reputation: 178
Quote:
Originally Posted by TB0ne View Post
Could be because the "babel" command isn't in your path when you run the script.
In the name of the Flying Spaghetti Monster,

I just tried that with a nonexistent "babel", and got -1, not 32512. 32512 in hex is 7F00. According to the man page for waitpid(), this indicates a return code of 127 from the program. You should find out why babel is returning with an exit code of 127.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cdebootstrap error 32512 couldn't install system due to errors! cnov Debian 0 08-06-2008 08:04 AM
Error in Perl Code : Bad switch statement(Problem in code block)? near ## line # suyog255 Programming 4 02-20-2008 05:35 PM
Can't seem to run a simple shell script error command not found each time SimonT Linux - Newbie 5 10-29-2006 06:31 AM
run shell command inside of c code? khucinx Programming 2 05-17-2004 10:04 AM


All times are GMT -5. The time now is 06:42 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration