The UNIX and Linux Forums  


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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 02-10-2009
vgersh99's Avatar
vgersh99 vgersh99 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,128
Quote:
Originally Posted by learnbash View Post
Hello,

thanks for your reply, but i want to replace only true output to "1", ls always return "0" how could i replace only ls command output to "1".

Thanks,
Bash
no, 'ls' does not always return '0'.
here's what 'man ls' yields:
Code:
EXIT STATUS
     0     All information was written successfully.

     >0    An error occurred.
just curious, why would you want to return a non-zero value when 'ls' was successful?