Perl Error Code 256
Contents |
Reply 3 Replies - 25036 Views - Last Post: 13 July 2009 - 03:39 AM #1 Anand Choudhary New D.I.C Head Reputation: 0 Posts: 2 Joined: 06-July 09 Return value 256 Posted 07 July 2009 - 04:28 AM Hi All, I'd like to know what does return exit code 256 in unix value 256 means in Perl.Is this any error value which describes that program is not functioning exit code 256 informatica properly? Please help. Regards, Anand Is This A Good Question/Topic? 0 Back to top MultiQuote Quote + Reply Replies To: Return value 256 #2 kmangold
Perl Return Code 2
D.I.C Head Reputation: 11 Posts: 167 Joined: 24-June 09 Re: Return value 256 Posted 07 July 2009 - 04:31 AM "Just a note, when using system in perl, it returns the exit code multiplied by 256. So, if a command returns
Perl System Exit Code
1, system("command") will return 256. So, to get the real return value, divide by 256." (source)) Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply #3 Anand Choudhary New D.I.C Head Reputation: 0 Posts: 2 Joined: 06-July 09 Re: Return value 256 Posted 12 July 2009 - 11:25 PM Thanks for your reply. So here I am getting return value 256 means its 1.Actually my code..runs through cronjob and matches system date from a log file which is also being wexitstatus run by cronjob and both code runs per minute by cronjob. So here actual problem is that same code given return value 0 all time but some times it throws return code 256 means 1 i.e. error. Please help..Why same code behaves in different manner. Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply #4 dsherohman Perl Parson Reputation: 227 Posts: 654 Joined: 29-March 09 Re: Return value 256 Posted 13 July 2009 - 03:39 AM Anand Choudhary, on 13 Jul, 2009 - 06:25 AM, said:So here actual problem is that same code given return value 0 all time but some times it throws return code 256 means 1 i.e. error. Please help..Why same code behaves in different manner. Without more information about the code in question, what it does, and the conditions under which it succeeds vs. when it fails, there's no way that we can answer this beyond saying "because the code chose to exit with a status of 1". The meaning of non-zero status codes is application-specific with no standard convention beyond "zero means unexceptional success, anything else means something out of the ordinary (which may or may not be an actual failure) happened". Was This Post Helpful? 0 Back to top MultiQuote Quote + Reply ← Previous Topic Perl Next Topic → Page 1 of 1 Related TopicsbetaPassing Return Value Between Sub Routines In PerlPassing Return Value Between Sub Routines In Perl Return Value From Symbolic Linked Perl Program Has
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
Perl System Call
workings and policies of this site About Us Learn more about Stack linux exit code Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs unix exit codes Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join http://www.dreamincode.net/forums/topic/113508-return-value-256/ them; it only takes a minute: Sign up Why is the return value of Perl's system not what I expect? up vote 2 down vote favorite Let me begin by explaining what I'm trying to accomplish. Essentially there are two Perl scripts. One is what I call the Main script with an UI. The user who runs this script http://stackoverflow.com/questions/3882677/why-is-the-return-value-of-perls-system-not-what-i-expect will see a list of other scripts he can call from the menu. This list is loaded through a custom config file. The purpose of the main script is to be able to add other scripts in the future as needed without changing the source and be run either as cron job (Non-Interactive mode) and as the user needs (Interactive Mode). As company policy, I am not entitle to post the entire script, so I will post the Interactive-Mode user selection section: for($i = 0;$i < @{$conf}+1;$i++) { if($i % 2 == 1 || $i == 0) { next; } print $n++ . ". @{$conf}[$i-1]\n"; } print "(health_check) "; # # User selection # my $in = <>; chomp($in); if($in =~ /[A-Za-z]/) { write_log("[*] Invalid Selection: $in"); print "\n<<<<<<<<<<<<>>>>>>>>>>>>>\n"; print ">>> Invalid Selection <<<\n"; print "<<<<<<<<<<<<>>>>>>>>>>>>>\n"; } elsif($in == 0) { write_log("Exiting interactive mode"); last; } elsif(scalar($scripts[$in])) { write_log("[*] running: $scripts[$in]"); $rez = system('./' . "$scripts[$in]"); if($rez == 0b00) { printf("%s: [OK]\n",$scripts[$in]); } elsif($rez == 0b01) { printf("%s: [WARNING]\n",$scripts[$in]); } elsif($rez == 0b11) { printf("%s:
>ExampleComments1Catchall for general errorslet "var1 = 1/0"Miscellaneous errors, such as "divide by zero" and other impermissible operations2http://www.tldp.org/LDP/abs/html/exitcodes.html >Misuse of shell builtins (according to Bash documentation)empty_function() {}Missing keyword or command, or permission problem (and diff return code on a failed binary file comparisonhttp://datawarehouse.ittoolbox.com/groups/technical-functional/informatica-l/error-while-executing-shell-script-return-code-256-1573493 >).126Command invoked cannot execute/dev/nullPermission problem or command is not an executable127"command not found"illegal_commandPossible problem with $PATH or exit code a typo128Invalid argument to exitexit 3.14159exit takes only integer args in the range 0 - 255 (see first footnote)128+nFatal error signal "n"kill -9 $PPID of script$? returns 137 (128 + 9)130Script terminated by Control-CCtl-CControl-C exit code 256 is fatal error signal 2, (130 = 128 + 2, see above)255*Exit status out of rangeexit -1exit takes only integer args in the range 0 - 255
Technology and Trends Enterprise Architecture and EAI ERP Hardware IT Management and Strategy Java Knowledge Management Linux Networking Oracle PeopleSoft Project and Portfolio Management SAP SCM Security Siebel Storage UNIX Visual Basic Web Design and Development Windows < Back CHOOSE A DISCUSSION GROUP Research Directory TOPICS Database Hardware Networking SAP Security Web Design MEMBERS Paul_Pedant DACREE MarkDeVries Inside-ERP Inside-CRM MacProTX VoIP_News I_am_the_dragon maxwellarnold Michael Meyers-Jouan TerryCurran Chris_Day Andrew.S.Baker Ramnath.Awate JoeTorre Craig Borysowich Locutus Dennis Stevenson DukeGanote Richard iudithm mircea_luca Clinton Jones bracke Nikki Klein AbhaiTripathi Adrian_Grigoriu Iqbalyk numbersguyPA RichardChan COMPANIES Wave Direct Avaya Pivotal CRM SendGrid View All Topics View All Members View All Companies Toolbox for IT Topics Data Warehouse Groups Ask a New Question Informatica The Informatica group is your premier resource for objective technical discussion and peer-to-peer support on Informatica data integration software. Home | Invite Peers | More Data Warehouse Groups Your account is ready. You're now being signed in. Solve problems - It's Free Create your account in seconds E-mail address is taken If this is your account,sign in here Email address Username Between 5 and 30 characters. No spaces please The Profile Name is already in use Password Notify me of new activity in this group: Real Time Daily Never Keep me informed of the latest: White Papers Newsletter Jobs By clicking "Join Now", you agree to Toolbox for Technology terms of use, and have read and understand our privacy policy. error while executing shell script return code 256 syecomp asked Aug 16, 2007 | Replies (2) hi all, i am trying to call shell script in post session command, eg: ksh command.sh var1 var2.sh var3 where var2.sh is another script called within command.sh. its working fine in command line,but giving an error in Informatica. i am using Informatica 7.1.3, HP-UX env. Thanks in advance. Join this group Popular White Paper On This Topic Best Practices for SMB BI 2Replies Best Answer 0 Mark this reply as the best answer?(Choose carefully, this can't be changed) Yes | No Saving... Rajiv R Chitlur replied Aug 16, 2007 It will fail because, the script might not have enough permissions or it might be run through a different use when run