The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mandriva: 'ghostscript' arbitrary code execution iBot Security Advisories (RSS) 0 02-29-2008 03:10 PM
perl - understand process status and continue the code execution sysgate Shell Programming and Scripting 2 01-04-2008 09:23 AM
execution status of gotoURL in Win32::IEAutomation gurukottur Shell Programming and Scripting 2 11-22-2007 03:27 AM
Capturing last command execution status in a script. videsh77 Shell Programming and Scripting 2 04-12-2007 02:19 PM
Failed to check status code in "rsh" command nir_s Shell Programming and Scripting 9 07-03-2006 10:05 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-21-2006
tipsy tipsy is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 35
Thumbs up Status code of last command execution

Hello people,

I am using KSH and inside my script I do a cksum and check the status code to see whether the command sucessfully. Here even though the cksum fails due to file not existing the status returned is still 0 because the awk command worked fine. How do I capture just the status of the cksum command execution without breaking the below listed code into multiple lines. Please let me know.

/usr/bin/cksum $cksum_tmpdir/$EXTFILE | awk '{print $1 $2}' > $cksumb
echo $?

Regards,
Tipsy.
  #2 (permalink)  
Old 07-21-2006
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
This thread provides one way to resolve this.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0