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

  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 Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 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 12-17-2010
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 26 June 2014, 10:29 AM EDT
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 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 12-17-2010
Scott's Avatar
Scott Scott is online now Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 2 August 2014, 4:33 AM EDT
Location: Zürich
Posts: 8,438
Thanks: 328
Thanked 1,032 Times in 903 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 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 Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:41 AM
Need your Help on Unix Shell Scripting......... vinayraj UNIX for Advanced & Expert Users 5 02-08-2008 06:00 AM
Shell Scripting (Unix) tt1ect Shell Programming and Scripting 3 04-15-2007 09:15 AM
Unix shell scripting Maruthi Kunnuru Shell Programming and Scripting 4 05-23-2006 12:19 AM
difference between AIX shell scripting and Unix shell scripting. haroonec Shell Programming and Scripting 2 04-12-2006 08:12 AM



All times are GMT -4. The time now is 04:35 AM.