$# in unix shell scripting what does it mean | Unix Linux Forums | Shell Programming and Scripting

  Unix/Linux Go Back    


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

$# in unix shell scripting what does it mean

Shell Programming and Scripting


Tags
$# unix shell scripting

Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-17-2010
einsteinBrain einsteinBrain is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 12 March 2012, 1:47 PM EDT
Posts: 14
Thanks: 9
Thanked 0 Times in 0 Posts
$# in unix shell scripting what does it mean

Hi can some one let me know what is the meaning of

$#

$@

$_

@_ in unix shell scripting.

I really appreciate your time for replying to my post.

Thanks In Advance
Sponsored Links
    #2  
Old Unix and Linux 12-17-2010
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 4 March 2015, 6:26 AM EST
Location: France
Posts: 2,930
Thanks: 81
Thanked 624 Times in 596 Posts
Check this
The Following User Says Thank You to ctsgnb For This Useful Post:
einsteinBrain (12-17-2010)
Sponsored Links
    #3  
Old Unix and Linux 12-17-2010
einsteinBrain einsteinBrain is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 12 March 2012, 1:47 PM EDT
Posts: 14
Thanks: 9
Thanked 0 Times in 0 Posts
Thanks a lot for the link.

so $# returns the input arguments ?

---------- Post updated at 01:50 PM ---------- Previous update was at 01:48 PM ----------

can someone explian them insimple words?
    #4  
Old Unix and Linux 12-17-2010
Scott's Unix or Linux Image
Scott Scott is online now Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 6 March 2015, 3:52 AM EST
Location: Zürich
Posts: 8,530
Thanks: 336
Thanked 1,065 Times in 928 Posts
$# represents the number of arguments:


Code:
$ set -- a
$ echo $#
1

$ set -- a b c
$ echo $#
3

The Following 2 Users Say Thank You to Scott For This Useful Post:
einsteinBrain (12-17-2010), nag_sathi (05-21-2013)
Sponsored Links
    #5  
Old Unix and Linux 12-17-2010
einsteinBrain einsteinBrain is offline
Registered User
 
Join Date: Dec 2010
Last Activity: 12 March 2012, 1:47 PM EDT
Posts: 14
Thanks: 9
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by scottn View Post
$# represents the number of arguments:


Code:
$ set -- a
$ echo $#
1
 
$ set -- a b c
$ echo $#
3

I understood it very clearly now..

Thanks a lot scottn
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unix shell scripting swarna bhat Shell Programming and Scripting 1 05-11-2009 06:41 AM
Need your Help on Unix Shell Scripting......... vinayraj UNIX for Advanced & Expert Users 5 02-08-2008 07:00 AM
Shell Scripting (Unix) tt1ect Shell Programming and Scripting 3 04-15-2007 10:15 AM
Unix shell scripting Maruthi Kunnuru Shell Programming and Scripting 4 05-23-2006 01:19 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 09:12 AM



All times are GMT -4. The time now is 05:00 AM.