Sponsored Content
Top Forums Shell Programming and Scripting whats the difference between $* and $@ Post 302158060 by vino on Monday 14th of January 2008 06:25:22 AM
Old 01-14-2008
Quote:
Originally Posted by pbsrinivas
Hi,

whats the difference between $* and $@ in command line arguments to a shell scripts
Look into man sh under the section 'Special Parameters'
Code:
       *      Expands  to the positional parameters, starting from one.  When
              the expansion occurs within double quotes, it expands to a sin-
              gle  word  with  the  value  of each parameter separated by the
              first character of the IFS special variable.  That is, "$*"  is
              equivalent  to  "$1c$2c...",  where c is the first character of
              the value of the IFS variable.  If IFS is unset, the parameters
              are  separated  by  spaces.  If IFS is null, the parameters are
              joined without intervening separators.
       @      Expands to the positional parameters, starting from one.   When
              the  expansion  occurs  within  double  quotes,  each parameter
              expands to a separate word.  That is,  "$@"  is  equivalent  to
              "$1"  "$2"  ...   When there are no positional parameters, "$@"
              and $@ expand to nothing (i.e., they are removed).

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Whats the difference between...

the various distros of free Linux and other *nix OSes? I'm curious. (1 Reply)
Discussion started by: hype.it
1 Replies

2. Post Here to Contact Site Administrators and Moderators

Whats the go?

woofie, Your posts are being deleted because your use of profanity. I am close to changing your status to read only. In fact, if you argue with the mods again, I will ban you from these boards. Neo (1 Reply)
Discussion started by: Neo
1 Replies

3. What is on Your Mind?

Whats Behind Your Name?

Looking at the member list, there are alot of interesting names, some unique, some bizarre, and some that are just plain. How did you come by your name? Why did you choose your label? Me? Well, I wish I could change mine. I chose Google because thats how I stumbled upon this site. I wasn't sure... (66 Replies)
Discussion started by: google
66 Replies

4. UNIX for Dummies Questions & Answers

Linux OR Unix Whats The Difference!

What is the difference bettween linux and unix? Sorry but I am really new to this! :confused: Also are they BOTH free :-D (1 Reply)
Discussion started by: jamesthemagicia
1 Replies

5. UNIX for Dummies Questions & Answers

whats the difference between zombie orpha and defunct processes

can some one please explain zombie orphan defunct and how they r related (3 Replies)
Discussion started by: pbsrinivas
3 Replies

6. UNIX for Dummies Questions & Answers

Whats the difference between $status and $?

Hi, In linux we have exit status variable ($?) and status which tells whether last command was successfull or not. Can someone please tell me what is difference between both. Both tells whether command was successful or not, Any particular difference between them? Thanks in Advance. Thanks... (3 Replies)
Discussion started by: sarbjit
3 Replies

7. Programming

mmap and malloc, whats the difference?

In what situations one would use malloc instead of mmap and vice versa. Both return a virtual addr ptr. So whats the difference? (4 Replies)
Discussion started by: dragonpoint
4 Replies

8. Programming

what is the main difference between difference between using nonatomic lseek and O_APPEND

I think both write at the end of the file ...... but is there a sharp difference between those 2 instruction ..... thank you this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies

9. Shell Programming and Scripting

awk to calculate difference of split and sum the difference

In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13. I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies
fdim(3M)																  fdim(3M)

NAME
fdim(), fdimf(), fdiml(), fdimw(), fdimq() - positive difference functions SYNOPSIS
HP Integrity Server Only DESCRIPTION
The function determines the positive difference between its arguments. Integrity Server Only is a version of it takes arguments and returns a result. is a version of it takes arguments and returns a result. is an version of it takes arguments and returns an result. is equivalent to on HP-UX systems. USAGE
To use this function, compile either with the default option or with the and options. To use (for Integrity servers) or compile with the option. Make sure your program includes Link in the math library by specifying on the compiler or linker command line. RETURN VALUE
The function returns the positive difference between x and y. If x y, returns x y (and raises any exceptions resulting from the subtraction). If x y, returns +zero. If x or y is NaN, returns NaN. If both arguments are NaNs, returns NaN. returns a positively signed infinity in lieu of a value whose magnitude is too large, and raises the overflow and inexact exceptions. ERRORS
No errors are defined. SEE ALSO
fdim(3M), fmin(3M), math(5). STANDARDS CONFORMANCE
: ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'') fdim(3M)
All times are GMT -4. The time now is 10:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy