hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Success and Failure return codes from UNIX shell scripts

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions
View previous topic :: View next topic  
Author Message
SysArch



Joined: 05 Aug 2010
Posts: 5

PostPosted: Tue Aug 24, 2010 11:44 am    Post subject: Success and Failure return codes from UNIX shell scripts Reply with quote

Hi. I was wondering how I can I have Automize kick off a shell script in the AIX UNIX environment, and have Automize process the next task in the schedule based off of a defined return code in the script. In other words, how can "I" tell Automize that the shell script has either succeeded or failed based on conditions or logic that I set forth in the shell script. Thanks in advance for your help!
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Tue Aug 24, 2010 4:29 pm    Post subject: Reply with quote

yes, there is a task sequence task that can run 2 tasks in sequence . the second one can run only if exit code= 0 etc..

you would have to 3 tasks.. one command task for each script and the task sequence task to run the 2 tasks.
Back to top
View user's profile Send private message
SysArch



Joined: 05 Aug 2010
Posts: 5

PostPosted: Wed Aug 25, 2010 11:52 am    Post subject: Success and Failure return codes from UNIX shell scripts Reply with quote

"the second one can run only if exit code= 0 etc.. "

My question was how exactly do you go about setting the exit code in the shell script so that "I" can define the success or failure of my script rather than UNIX? Thanks.
Back to top
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 635
Location: Santa Barbara, california

PostPosted: Thu Aug 26, 2010 8:42 pm    Post subject: Reply with quote

check the programming manual. there is normally a function to set the exit code.
In windows batch files , it is
SET ERRORLEV = 1
In unix sh scripts, it is
exit 1
Back to top
View user's profile Send private message Send e-mail
SysArch



Joined: 05 Aug 2010
Posts: 5

PostPosted: Fri Aug 27, 2010 11:52 am    Post subject: Success and Failure return codes from UNIX shell scripts Reply with quote

Thank you! That is exactly what I was looking for.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Frequently Asked Questions All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group