GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 5 of 47    Print  
What does $# stand for?

  
Total Answers and Comments: 5 Last Update: March 25, 2007   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: cmanne
 
$# returns the number of parameters that are passed to a shell script
$? returns the exit code of the last executed command (0 : Successful, 1 or other: Failed)

Above answer was rated as good by the following members:
jrgalaura, Jenson Kuriakose
June 02, 2005 07:24:15   #1  
Muthu        

RE: What does $# stand for?
$# will return the number of parameters that are passed as the command-line arguments.
 
Is this answer useful? Yes | No
July 29, 2005 08:12:54   #2  
Raj        

RE: What does $# stand for?
$# means number of positional parameters set
 
Is this answer useful? Yes | No
June 15, 2006 11:45:12   #3  
Max        

RE: What does $# stand for?
Print $#This will return the last command is run successfully or not.If it will return 0 then it ran successfully. And if it will return other then 0 thenThere is some problem
 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
August 10, 2006 07:25:30   #4  
Srinivas        

RE: What does $# stand for?
I think it is $? not $# which returns the status of the last executed command
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 1Overall Rating: -N/A-    
March 25, 2007 20:08:27   #5  
cmanne Member Since: January 2006   Contribution: 49    

RE: What does $# stand for?
$# returns the number of parameters that are passed to a shell script
$? returns the exit code of the last executed command (0 : Successful 1 or other: Failed)

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape