Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and 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: 22 July 2015, 12:40 PM EDT
Location: France
Posts: 2,933
Thanks: 81
Thanked 627 Times in 598 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 offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 27 August 2015, 3:25 PM EDT
Location: Zürich
Posts: 8,575
Thanks: 337
Thanked 1,080 Times in 938 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

Linux 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 06:50 AM.