Perl Error Code 32512
Contents |
HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Non-*NIX Forums > Programming 32512 error code in Perl when trying to run shell command User Name Remember Me? Password Programming This forum exit code 32512 in unix is for all programming questions. The question does not have to be directly related error 32512 to Linux and any language is fair game. Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing command task failed with exit code 32512 in informatica 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
Exit Code 256
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 exit code 127 this page to clear all LQ-related cookies. Introduction to Linux - A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 11-29-2010, 06:10 AM #1 basher400 Member Registered: Mar 2005 Posts: 54 Rep: 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/l
In a Unix shell, executing "myprogram | tee afile.log" always returns the exit status of myprogram, which is what I desire. When I do this in Perl 5, forcing a return code of 127 in myprogram, the above system wexitstatus call returns 0. If I remove the "| tee afile.log" from the system command, the return value is as expected, 32512. (127 * 256). Any ideas on how to get around this? I can not simply add "> afile.log" to the command due to other requirements. Thanks in advance. Wed, 18 Jun 1902 08:00:00 GMT Greg Andre#2 / 6 system return code problem Quote: >I am trying to execute a system call such as: >system( "myprogram | tee http://www.linuxquestions.org/questions/programming-9/32512-error-code-in-perl-when-trying-to-run-shell-command-847192/ afile.log" ); >In a Unix shell, executing "myprogram | tee afile.log" always >returns the exit status of myprogram, which is what I desire. In my experience, the exit code of a pipeline does NOT come from the first command in the pipeline. In fact, the Solaris 2.6 man page for sh has this to say about pipelines: A pipeline is a sequence of one or more commands separated by |. The standard output of each http://computer-programming-forum.com/53-perl/f2875ed91fd73aeb.htm command but the last is connected by a pipe(2) to the standard input of the next command. Each command is run as a separate process; the shell waits for the last command to terminate. The exit status of a pipeline is the exit status of the last command in the pipeline. See that last sentence? The exit code comes from the last command in the pipeline, not the first. This is consistent with the test results you posted. If you want to have the output of the first command go to stdout and a file, yet capture the first command's exit code instead of the exit code from tee, then perform the tee function in your Perl script. I've done similar things in my scripts. -Greg -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Wed, 18 Jun 1902 08:00:00 GMT Charles DeRyk#3 / 6 system return code problem Quote:>I am trying to execute a system call such as: >system( "myprogram | tee afile.log" ); >... >When I do this in Perl 5, forcing a return code of 127 in myprogram, >the above system call returns 0. >If I remove the "| tee afile.log" from the system command, the >return value is as expected, 32512. (127 * 256). >Any ideas on how to get around this? I can not simply add >"> afile.log" to the command due to other
Scripting BSD, Linux, and Unix shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here. Search Forums http://www.unix.com/shell-programming-and-scripting/234211-perl-system-run-script.html Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find All Thanked Posts Go to Page... learn unix and linux commands Perl system() to run a script Shell Programming and Scripting Tags csso, perl, system() Page 1 of 2 1 2 > Thread Tools Search this Thread Display Modes #1 08-27-2013 madispuk Registered User exit code Join Date: Aug 2013 Last Activity: 10 December 2013, 3:48 AM EST Posts: 7 Thanks: 2 Thanked 0 Times in 0 Posts Perl system() to run a script Hello, I'm trying to run "csso" (minify css) in a CGI script from the web panel. That is not working: Returns error 0; my $cmd = qq`csso stylesheet.css > stylesheet.min.css`; system($cmd); But that is working: my $cmd exit code 32512 = qq`echo 'blabla' > stylesheet.min.css`; system($cmd); I'm using full paths. It looks like "csso" doesn't have write permissions or something? CentOS is the operating system. Thanks. Last edited by madispuk; 08-27-2013 at 06:52 AM.. Remove advertisements Sponsored Links madispuk View Public Profile Find all posts by madispuk #2 08-27-2013 rajamadhavan Registered User Join Date: Aug 2010 Last Activity: 11 August 2014, 2:25 AM EDT Location: Bangalore, India Posts: 279 Thanks: 4 Thanked 58 Times in 57 Posts Did it work when you run it outside the perl script on the shell ? Remove advertisements Sponsored Links rajamadhavan View Public Profile Find all posts by rajamadhavan #3 08-27-2013 madispuk Registered User Join Date: Aug 2013 Last Activity: 10 December 2013, 3:48 AM EST Posts: 7 Thanks: 2 Thanked 0 Times in 0 Posts Yes. I even tried to run it as an apache (and it works): su -s /bin/sh apache -c "[COMMAND]" madispuk View Public Profile Find all posts by madispuk #4 08-27-2013 rajamadhavan Registered User Join Date: Aug 2010 Last Activity: 11 August 2014, 2:25 AM EDT Location: Bangalore, India Posts: 279 Thanks: 4 Thanked 58 Ti