Make The Error Code From The Last Command Is 126
Contents |
team • Delete all board cookies • All times are UTC - 5 hours [ DST ] Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD. Search exit status 2 Forums Show Threads Show Posts Tag Search Advanced Search Unanswered Threads Find exit code 127 All Thanked Posts Go to Page... learn linux and unix commands - unix shell scripting Exit Status 126 /bin/bash^m: bad interpreter: no such file or directory - how to get rid of it UNIX for Advanced & Expert Users Tags apache-tomcat, exit status, perl, shell Thread Tools Search this Thread Display Modes http://forum.wrfforum.com/viewtopic.php?f=27&t=338 #1 09-18-2009 glamo_2312 Registered User Join Date: Sep 2008 Last Activity: 18 February 2010, 6:47 AM EST Location: INDIA Posts: 19 Thanks: 0 Thanked 0 Times in 0 Posts Exit Status 126 - how to get rid of it Hi All, I have a small application hosted on apache-tomcat 5. Basically its a html page which in turn calls a perl http://www.unix.com/unix-for-advanced-and-expert-users/119503-exit-status-126-how-get-rid.html script residing on unix server. Through this perl script i am calling a shell script using system command , like system('scriptname.sh',arg1,arg2,arg3); Now in the script 'scriptname.sh' i am try to run a c-program executable which is compiled on unix itself. The problem is that except that command[c-executable] all other statements gets executed. On further investigation i found that , it is giving 126 as exit status which means "Command was found but could not be executed". Can any of you experts please help me to come out of this problem Thanks in advance. Remove advertisements Sponsored Links glamo_2312 View Public Profile Find all posts by glamo_2312 #2 09-18-2009 pludi Cat herder Join Date: Dec 2008 Last Activity: 28 March 2014, 8:35 AM EDT Location: Vienna, Austria, Earth Posts: 5,521 Thanks: 38 Thanked 335 Times in 308 Posts Since every process hands down its permissions to its children (UID/GID/...), the script effectively gets called as the user running Tomcat. If that user doesn't have execute permissions on the script, it can't be run. Remove advertisements Sponsored Links pludi View Public Profile Find all posts by pludi #3 09-18-20
here for a quick overview of the site Help Center http://stackoverflow.com/questions/9979251/error-with-bash-script-exit-code-126 Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss exit code Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error with bash script “exit code 126” up vote 1 down vote favorite 1 I want integrate CPD (Copy-Paste-Detection) make the error to my iOS project. I read about it here and here. To automatically determine CopyPaste in the code I'm using bash script: echo "Checking files in ${SOURCE_ROOT}" JARS_DIR=${PROJECT_DIR}/CPD FULL_PATH_TO_CPD_XML_OUTPUT=${PROJECT_DIR}/cpd-output.xml # Running CPD java -classpath "${JARS_DIR}/ObjCLanguage-0.0.5-SNAPSHOT.jar:${JARS_DIR}/pmd.jar" net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files "${SOURCE_ROOT}" -v --language ObjectiveC --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > "${FULL_PATH_TO_CPD_XML_OUTPUT}" # Running self :) ${BUILT_PRODUCTS_DIR} -cpd-xml "${FULL_PATH_TO_CPD_XML_OUTPUT}" That code create cpd-output.xml file. But take me an error at compile time "Command /bin/sh failed with exit code 126". Here is log copy http://pastebin.com/359k1Wni I took the code from this example project Error is going then I comment this string: ${BUILT_PRODUCTS_DIR} -cpd-xml "${FULL_PATH_TO_CPD_XML_OUTPUT}" I tried to find what ever information about this error, but found only a few of these problems without answers. I'm not know anything about bash scripting. I will be happy with any advice. Thank you for your attention. P.S. Author of following the