Unix/Linux Go Back    


Shell Programming and Scripting BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

$# in unix shell scripting what does it mean

Shell Programming and Scripting


Tags
$# unix shell scripting

Closed    
 
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: 10 November 2016, 10:40 AM EST
Location: France
Posts: 2,948
Thanks: 82
Thanked 630 Times in 601 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: 7 December 2016, 12:24 PM EST
Location: Zürich
Posts: 8,598
Thanks: 343
Thanked 1,093 Times in 949 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

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 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 11:49 PM.